mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-09-22 04:15:02 +00:00
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>
This commit is contained in:
parent
36f20c6df7
commit
ff6040667a
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
struct nfs4_client *clp = state->owner->so_client;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
down_read(&clp->cl_sem);
|
|
||||||
/* Is this a delegated open? */
|
/* Is this a delegated open? */
|
||||||
if (test_bit(NFS_DELEGATED_STATE, &state->flags)) {
|
if (NFS_I(state->inode)->delegation_state != 0) {
|
||||||
/* Yes: cache locks! */
|
/* Yes: cache locks! */
|
||||||
status = do_vfs_lock(request->fl_file, request);
|
status = do_vfs_lock(request->fl_file, request);
|
||||||
/* ...but avoid races with delegation recall... */
|
/* ...but avoid races with delegation recall... */
|
||||||
if (status < 0 || test_bit(NFS_DELEGATED_STATE, &state->flags))
|
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);
|
status = nfs4_set_lock_state(state, request);
|
||||||
if (status != 0)
|
if (status != 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Reference in a new issue