diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/lockd/clntproc.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 220058d8616d..970b6a6aa337 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c | |||
@@ -662,12 +662,18 @@ nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl) | |||
662 | * reclaimed while we're stuck in the unlock call. */ | 662 | * reclaimed while we're stuck in the unlock call. */ |
663 | fl->fl_u.nfs_fl.flags &= ~NFS_LCK_GRANTED; | 663 | fl->fl_u.nfs_fl.flags &= ~NFS_LCK_GRANTED; |
664 | 664 | ||
665 | /* | ||
666 | * Note: the server is supposed to either grant us the unlock | ||
667 | * request, or to deny it with NLM_LCK_DENIED_GRACE_PERIOD. In either | ||
668 | * case, we want to unlock. | ||
669 | */ | ||
670 | do_vfs_lock(fl); | ||
671 | |||
665 | if (req->a_flags & RPC_TASK_ASYNC) { | 672 | if (req->a_flags & RPC_TASK_ASYNC) { |
666 | status = nlmclnt_async_call(req, NLMPROC_UNLOCK, | 673 | status = nlmclnt_async_call(req, NLMPROC_UNLOCK, |
667 | &nlmclnt_unlock_ops); | 674 | &nlmclnt_unlock_ops); |
668 | /* Hrmf... Do the unlock early since locks_remove_posix() | 675 | /* Hrmf... Do the unlock early since locks_remove_posix() |
669 | * really expects us to free the lock synchronously */ | 676 | * really expects us to free the lock synchronously */ |
670 | do_vfs_lock(fl); | ||
671 | if (status < 0) { | 677 | if (status < 0) { |
672 | nlmclnt_release_lockargs(req); | 678 | nlmclnt_release_lockargs(req); |
673 | kfree(req); | 679 | kfree(req); |
@@ -680,7 +686,6 @@ nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl) | |||
680 | if (status < 0) | 686 | if (status < 0) |
681 | return status; | 687 | return status; |
682 | 688 | ||
683 | do_vfs_lock(fl); | ||
684 | if (resp->status == NLM_LCK_GRANTED) | 689 | if (resp->status == NLM_LCK_GRANTED) |
685 | return 0; | 690 | return 0; |
686 | 691 | ||