aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust2013-04-21 17:01:06 -0500
committerGreg Kroah-Hartman2013-05-07 22:08:23 -0500
commit97a12ae90a305b643a42fafe191d092f796d6179 (patch)
treef617896b93dc81790d360be9dbac53a2ad472b91 /fs
parentd76dc4af6d15b4f47dc2d01fd40938ce7675b568 (diff)
downloadkernel-omap-97a12ae90a305b643a42fafe191d092f796d6179.tar.gz
kernel-omap-97a12ae90a305b643a42fafe191d092f796d6179.tar.xz
kernel-omap-97a12ae90a305b643a42fafe191d092f796d6179.zip
LOCKD: Ensure that nlmclnt_block resets block->b_status after a server reboot
commit 1dfd89af8697a299e7982ae740d4695ecd917eef upstream. 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 <eshel@us.ibm.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/lockd/clntlock.c3
-rw-r--r--fs/lockd/clntproc.c3
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index ca0a08001449..193f04cc97ba 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)
144 timeout); 144 timeout);
145 if (ret < 0) 145 if (ret < 0)
146 return -ERESTARTSYS; 146 return -ERESTARTSYS;
147 /* Reset the lock status after a server reboot so we resend */
148 if (block->b_status == nlm_lck_denied_grace_period)
149 block->b_status = nlm_lck_blocked;
147 req->a_res.status = block->b_status; 150 req->a_res.status = block->b_status;
148 return 0; 151 return 0;
149} 152}
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index 52e5120bb159..54f9e6ce0430 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -550,9 +550,6 @@ again:
550 status = nlmclnt_block(block, req, NLMCLNT_POLL_TIMEOUT); 550 status = nlmclnt_block(block, req, NLMCLNT_POLL_TIMEOUT);
551 if (status < 0) 551 if (status < 0)
552 break; 552 break;
553 /* Resend the blocking lock request after a server reboot */
554 if (resp->status == nlm_lck_denied_grace_period)
555 continue;
556 if (resp->status != nlm_lck_blocked) 553 if (resp->status != nlm_lck_blocked)
557 break; 554 break;
558 } 555 }