From patchwork Thu Feb 28 14:43:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [066/139] NLM: Ensure that we resend all pending blocking locks after a reclaim X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 224041 Message-Id: <1362062689-2567-67-git-send-email-luis.henriques@canonical.com> To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Trond Myklebust Date: Thu, 28 Feb 2013 14:43:36 +0000 From: Luis Henriques List-Id: Kernel team discussions 3.5.7.7 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Trond Myklebust commit 666b3d803a511fbc9bc5e5ea8ce66010cf03ea13 upstream. Currently, nlmclnt_lock will break out of the for(;;) loop when the reclaimer wakes up the blocking lock thread by setting nlm_lck_denied_grace_period. This causes the lock request to fail with an ENOLCK error. The intention was always to ensure that we resend the lock request after the grace period has expired. Reported-by: Wangyuan Zhang Signed-off-by: Trond Myklebust Signed-off-by: Luis Henriques --- fs/lockd/clntproc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 8392cb8..a3a0987 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c @@ -551,6 +551,9 @@ again: status = nlmclnt_block(block, req, NLMCLNT_POLL_TIMEOUT); if (status < 0) break; + /* Resend the blocking lock request after a server reboot */ + if (resp->status == nlm_lck_denied_grace_period) + continue; if (resp->status != nlm_lck_blocked) break; }