summaryrefslogtreecommitdiff
path: root/fs/lockd
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-04-02 14:40:53 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-04-19 16:53:45 -0400
commit6b4b3a752b3464f2fd9fe2837fb19270c23c1d6b (patch)
tree02c504fd397a5bb4f484e1205e2568bbcddfc2c5 /fs/lockd
parent8ec7ff74448f65ac963e330795d771ab14ec8408 (diff)
downloadlwn-6b4b3a752b3464f2fd9fe2837fb19270c23c1d6b.tar.gz
lwn-6b4b3a752b3464f2fd9fe2837fb19270c23c1d6b.zip
NLM/lockd: Ensure that nlmclnt_cancel() returns results of the CANCEL call
Currently, it returns success as long as the RPC call was sent. We'd like to know if the CANCEL operation succeeded on the server. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/clntproc.c11
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 = {
static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl)
{
struct nlm_rqst *req;
+ int status;
+
+ dprintk("lockd: blocking lock attempt was interrupted by a signal.\n"
+ " Attempting to cancel lock.\n");
req = nlm_alloc_call(nlm_get_host(host));
if (!req)
@@ -708,7 +712,12 @@ static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl
nlmclnt_setlockargs(req, fl);
req->a_args.block = block;
- return nlmclnt_async_call(req, NLMPROC_CANCEL, &nlmclnt_cancel_ops);
+ atomic_inc(&req->a_count);
+ status = nlmclnt_async_call(req, NLMPROC_CANCEL, &nlmclnt_cancel_ops);
+ if (status == 0 && req->a_res.status == nlm_lck_denied)
+ status = -ENOLCK;
+ nlm_release_call(req);
+ return status;
}
static void nlmclnt_cancel_callback(struct rpc_task *task, void *data)