From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-Id: <20130518021651.943440696@goodmis.org> Date: Fri, 17 May 2013 22:17:00 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Marc Eshel , Trond Myklebust Subject: [ 063/136 ] LOCKD: Ensure that nlmclnt_block resets block->b_status after a server reboot References: <20130518021557.139113314@goodmis.org> Content-Disposition: inline; filename=0063-LOCKD-Ensure-that-nlmclnt_block-resets-block-b_statu.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.6.11.4 stable review patch. If anyone has any objections, please let me know. ------------------ From: Trond Myklebust [ Upstream commit 1dfd89af8697a299e7982ae740d4695ecd917eef ] After a server reboot, the reclaimer thread will recover all the existing locks. For locks that are blocked, however, it will change the value of block->b_status to nlm_lck_denied_grace_period in order to signal that they need to wake up and resend the original blocking lock request. Due to a bug, however, the block->b_status never gets reset after the blocked locks have been woken up, and so the process goes into an infinite loop of resends until the blocked lock is satisfied. Reported-by: Marc Eshel Signed-off-by: Trond Myklebust Cc: stable@vger.kernel.org Signed-off-by: Steven Rostedt --- fs/lockd/clntlock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c index ca0a080..193f04c 100644 --- a/fs/lockd/clntlock.c +++ b/fs/lockd/clntlock.c @@ -144,6 +144,9 @@ int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout) timeout); if (ret < 0) return -ERESTARTSYS; + /* Reset the lock status after a server reboot so we resend */ + if (block->b_status == nlm_lck_denied_grace_period) + block->b_status = nlm_lck_blocked; req->a_res.status = block->b_status; return 0; } -- 1.7.10.4