NFS: Fix put_nfs_open_context

We need to grab the inode->i_lock atomically with the last reference put in
order to remove the open context that is being freed from the
nfsi->open_files list.

Fix by converting the kref to a standard atomic counter and then using
atomic_dec_and_lock()...

Thanks to Arnd Bergmann for pointing out the problem.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
Trond Myklebust 2007-07-26 12:06:17 -04:00
parent b247bbf1da
commit 5e11934d13
2 changed files with 9 additions and 17 deletions

View file

@ -71,7 +71,7 @@ struct nfs_access_entry {
struct nfs4_state;
struct nfs_open_context {
struct kref kref;
atomic_t count;
struct path path;
struct rpc_cred *cred;
struct nfs4_state *state;