Commit d0dc3701 authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds

NFSv4: Give the lock stateid its own sequence queue

Sharing the open sequence queue causes a deadlock when we try to take
both a lock sequence id and and open sequence id.

This fixes the regression reported by Dimitri Puzin and Jeff Garzik: See

	http://bugzilla.kernel.org/show_bug.cgi?id=9712

for details.
Reported-and-tested-by: default avatarDimitri Puzin <bugs@psycast.de>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
Tested-by: default avatarJeff Garzik <jgarzik@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3a43e69c
...@@ -115,6 +115,7 @@ struct nfs4_lock_state { ...@@ -115,6 +115,7 @@ struct nfs4_lock_state {
#define NFS_LOCK_INITIALIZED 1 #define NFS_LOCK_INITIALIZED 1
int ls_flags; int ls_flags;
struct nfs_seqid_counter ls_seqid; struct nfs_seqid_counter ls_seqid;
struct rpc_sequence ls_sequence;
struct nfs_unique_id ls_id; struct nfs_unique_id ls_id;
nfs4_stateid ls_stateid; nfs4_stateid ls_stateid;
atomic_t ls_count; atomic_t ls_count;
......
...@@ -509,7 +509,10 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f ...@@ -509,7 +509,10 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f
lsp = kzalloc(sizeof(*lsp), GFP_KERNEL); lsp = kzalloc(sizeof(*lsp), GFP_KERNEL);
if (lsp == NULL) if (lsp == NULL)
return NULL; return NULL;
lsp->ls_seqid.sequence = &state->owner->so_sequence; rpc_init_wait_queue(&lsp->ls_sequence.wait, "lock_seqid_waitqueue");
spin_lock_init(&lsp->ls_sequence.lock);
INIT_LIST_HEAD(&lsp->ls_sequence.list);
lsp->ls_seqid.sequence = &lsp->ls_sequence;
atomic_set(&lsp->ls_count, 1); atomic_set(&lsp->ls_count, 1);
lsp->ls_owner = fl_owner; lsp->ls_owner = fl_owner;
spin_lock(&clp->cl_lock); spin_lock(&clp->cl_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment