diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-11-25 17:10:01 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-11-25 17:11:29 -0500 |
commit | ff6040667ad5a21fa1090e02941ecefb94ebe32c (patch) | |
tree | 63339e45fefb05ecf23071fb98c5b383972714d4 /fs | |
parent | 36f20c6df75d599393d79c7feb6283b20913e3d5 (diff) |
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 'fs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 6 |
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 | |||
3071 | struct nfs4_client *clp = state->owner->so_client; | 3071 | struct nfs4_client *clp = state->owner->so_client; |
3072 | int status; | 3072 | int status; |
3073 | 3073 | ||
3074 | down_read(&clp->cl_sem); | ||
3075 | /* Is this a delegated open? */ | 3074 | /* Is this a delegated open? */ |
3076 | if (test_bit(NFS_DELEGATED_STATE, &state->flags)) { | 3075 | if (NFS_I(state->inode)->delegation_state != 0) { |
3077 | /* Yes: cache locks! */ | 3076 | /* Yes: cache locks! */ |
3078 | status = do_vfs_lock(request->fl_file, request); | 3077 | status = do_vfs_lock(request->fl_file, request); |
3079 | /* ...but avoid races with delegation recall... */ | 3078 | /* ...but avoid races with delegation recall... */ |
3080 | if (status < 0 || test_bit(NFS_DELEGATED_STATE, &state->flags)) | 3079 | if (status < 0 || test_bit(NFS_DELEGATED_STATE, &state->flags)) |
3081 | goto out; | 3080 | return status; |
3082 | } | 3081 | } |
3082 | down_read(&clp->cl_sem); | ||
3083 | status = nfs4_set_lock_state(state, request); | 3083 | status = nfs4_set_lock_state(state, request); |
3084 | if (status != 0) | 3084 | if (status != 0) |
3085 | goto out; | 3085 | goto out; |