diff options
-rw-r--r-- | fs/lockd/clntproc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 5f13e0363b28..ea1a6940af22 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c | |||
@@ -699,6 +699,10 @@ static const struct rpc_call_ops nlmclnt_unlock_ops = { | |||
699 | static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl) | 699 | static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl) |
700 | { | 700 | { |
701 | struct nlm_rqst *req; | 701 | struct nlm_rqst *req; |
702 | int status; | ||
703 | |||
704 | dprintk("lockd: blocking lock attempt was interrupted by a signal.\n" | ||
705 | " Attempting to cancel lock.\n"); | ||
702 | 706 | ||
703 | req = nlm_alloc_call(nlm_get_host(host)); | 707 | req = nlm_alloc_call(nlm_get_host(host)); |
704 | if (!req) | 708 | if (!req) |
@@ -708,7 +712,12 @@ static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl | |||
708 | nlmclnt_setlockargs(req, fl); | 712 | nlmclnt_setlockargs(req, fl); |
709 | req->a_args.block = block; | 713 | req->a_args.block = block; |
710 | 714 | ||
711 | return nlmclnt_async_call(req, NLMPROC_CANCEL, &nlmclnt_cancel_ops); | 715 | atomic_inc(&req->a_count); |
716 | status = nlmclnt_async_call(req, NLMPROC_CANCEL, &nlmclnt_cancel_ops); | ||
717 | if (status == 0 && req->a_res.status == nlm_lck_denied) | ||
718 | status = -ENOLCK; | ||
719 | nlm_release_call(req); | ||
720 | return status; | ||
712 | } | 721 | } |
713 | 722 | ||
714 | static void nlmclnt_cancel_callback(struct rpc_task *task, void *data) | 723 | static void nlmclnt_cancel_callback(struct rpc_task *task, void *data) |