summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2005-11-25 23:10:01 +0100
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-11-25 23:11:29 +0100
commitff6040667ad5a21fa1090e02941ecefb94ebe32c (patch)
tree63339e45fefb05ecf23071fb98c5b383972714d4 /fs/nfs/nfs4proc.c
parentNFSv4: Fix buggy nfs_wait_on_sequence() (diff)
downloadlinux-ff6040667ad5a21fa1090e02941ecefb94ebe32c.tar.xz
linux-ff6040667ad5a21fa1090e02941ecefb94ebe32c.zip
NFSv4: Fix typo in lock caching
When caching locks due to holding a file delegation, we must always check against local locks before sending anything to the server. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to '')
-rw-r--r--fs/nfs/nfs4proc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 21482b2518f6..60e0dd800cc3 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3071,15 +3071,15 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock
struct nfs4_client *clp = state->owner->so_client;
int status;
- down_read(&clp->cl_sem);
/* Is this a delegated open? */
- if (test_bit(NFS_DELEGATED_STATE, &state->flags)) {
+ if (NFS_I(state->inode)->delegation_state != 0) {
/* Yes: cache locks! */
status = do_vfs_lock(request->fl_file, request);
/* ...but avoid races with delegation recall... */
if (status < 0 || test_bit(NFS_DELEGATED_STATE, &state->flags))
- goto out;
+ return status;
}
+ down_read(&clp->cl_sem);
status = nfs4_set_lock_state(state, request);
if (status != 0)
goto out;