[pnfs] [PATCH 9/9] pnfs client prevent race in sequence slot
andros at umich.edu
andros at umich.edu
Wed Sep 26 08:45:37 EDT 2007
From: Andy Adamson <andros at umich.edu>
Move the lock to cover reading the sequence list in rpc_sequence
which allowed multiple rpc's to be in flight with the same slot
sequence id.
Signed-off by: Andy Adamson<andros at umich.edu>
---
fs/nfs/nfs4state.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 4963454..cbc08af 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -773,15 +773,15 @@ int nfs_wait_on_sequence(struct nfs_seqid *seqid, struct rpc_task *task)
struct rpc_sequence *sequence = seqid->sequence->sequence;
int status = 0;
+ spin_lock(&sequence->lock);
if (sequence->list.next == &seqid->list)
goto out;
- spin_lock(&sequence->lock);
if (sequence->list.next != &seqid->list) {
rpc_sleep_on(&sequence->wait, task, NULL, NULL);
status = -EAGAIN;
}
- spin_unlock(&sequence->lock);
out:
+ spin_unlock(&sequence->lock);
return status;
}
--
1.5.0.2
More information about the pNFS
mailing list