summaryrefslogtreecommitdiff
path: root/fs/nfs/nfs4state.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-02-07 10:54:07 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-02-11 15:33:13 -0500
commit65b62a29f719e937b5be1df472287f4c61e53ac6 (patch)
treeea6b552a08883d92cfedb891044fa9697cbc5619 /fs/nfs/nfs4state.c
parent37380e4264dbda9753e470a30d4322097aab7152 (diff)
NFSv4: Ensure delegation recall and byte range lock removal don't conflict
Add a mutex to the struct nfs4_state_owner to ensure that delegation recall doesn't conflict with byte range lock removal. Note that we nest the new mutex _outside_ the state manager reclaim protection (nfsi->rwsem) in order to avoid deadlocks. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r--fs/nfs/nfs4state.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index fff97228cdec..6ace365c6334 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -519,6 +519,7 @@ nfs4_alloc_state_owner(struct nfs_server *server,
atomic_set(&sp->so_count, 1);
INIT_LIST_HEAD(&sp->so_lru);
seqcount_init(&sp->so_reclaim_seqcount);
+ mutex_init(&sp->so_delegreturn_mutex);
return sp;
}