From 81abfa97ddc1cebd77cb719072cec08ec21e07d9 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Mon, 13 Mar 2006 21:20:49 -0800 Subject: [PATCH] --- yaml --- r: 21033 b: refs/heads/master c: 30f4e20a0d3492668f5065af582b5af2d1e4256b h: refs/heads/master i: 21031: 9a792e4426d50a80288156818d382f97b33e87ba v: v3 --- [refs] | 2 +- trunk/fs/lockd/clntproc.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index a4907b3f88ca..cda218acf645 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e6d83d55698b73b4d5d55d3d7715a4c26030d577 +refs/heads/master: 30f4e20a0d3492668f5065af582b5af2d1e4256b diff --git a/trunk/fs/lockd/clntproc.c b/trunk/fs/lockd/clntproc.c index 220058d8616d..970b6a6aa337 100644 --- a/trunk/fs/lockd/clntproc.c +++ b/trunk/fs/lockd/clntproc.c @@ -662,12 +662,18 @@ nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl) * reclaimed while we're stuck in the unlock call. */ fl->fl_u.nfs_fl.flags &= ~NFS_LCK_GRANTED; + /* + * Note: the server is supposed to either grant us the unlock + * request, or to deny it with NLM_LCK_DENIED_GRACE_PERIOD. In either + * case, we want to unlock. + */ + do_vfs_lock(fl); + if (req->a_flags & RPC_TASK_ASYNC) { status = nlmclnt_async_call(req, NLMPROC_UNLOCK, &nlmclnt_unlock_ops); /* Hrmf... Do the unlock early since locks_remove_posix() * really expects us to free the lock synchronously */ - do_vfs_lock(fl); if (status < 0) { nlmclnt_release_lockargs(req); kfree(req); @@ -680,7 +686,6 @@ nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl) if (status < 0) return status; - do_vfs_lock(fl); if (resp->status == NLM_LCK_GRANTED) return 0;