OpenVZ Forum


Home » Mailing lists » Devel » [PATCH v2 0/4] SUNRPC: several fixes around PipeFS objects
RE: [PATCH v2 1/4] SUNRPC: release per-net clients lock before calling PipeFS dentries creation [message #45349 is a reply to message #45348] Mon, 27 February 2012 17:11 Go to previous messageGo to previous message
David Laight is currently offline  David Laight
Messages: 3
Registered: December 2011
Junior Member
> Gmmm.
> Please, correct me, if I'm wrong, that you are proposing
> something like this:
>
> spin_lock(&sn->rpc_client_lock);
> again:
> list_for_each_entry(clnt,&sn->all_clients, cl_clients) {
> if ((event == RPC_PIPEFS_MOUNT) && clnt->cl_dentry) ||
> (event == RPC_PIPEFS_UMOUNT) && !clnt->cl_dentry))
> continue;
> atomic_inc(&clnt->cl_count);
> spin_unlock(&sn->rpc_client_lock);
> error = __rpc_pipefs_event(clnt, event, sb);
> rpc_release_client(clnt);
> spin_lock(&sn->rpc_client_lock);
> if (error)
> break;
> goto again;
> }
> spin_unlock(&sn->rpc_client_lock);

You might manage to request reference to the 'next'
item while holding the lock. So maybe a loop that has:

error = ...
if (error) {
rpc_release_client(clnt);
break;
}
spin_lock(&sn->rpc_client_lock);
next_clnt = list_next(clnt);
if (next_clnt)
atomic_inc(&next_clnt->cl_count);
spin_unlock(&sn->rpc_client_lock);
rpc_release_client(clnt);
clnt = next_clnt;
} while (clnt != NULL);

David
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH 2/4] NFS: replace per-net client lock by mutex
Next Topic: [PATCH v3 0/4] SUNRPC: several fixes around PipeFS objects
Goto Forum:
  


Current Time: Mon Aug 18 19:57:49 GMT 2025

Total time taken to generate the page: 0.16659 seconds