]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
LOCKD: Ensure that nlmclnt_block resets block->b_status after a server reboot
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sun, 21 Apr 2013 22:01:06 +0000 (18:01 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2013 02:51:56 +0000 (19:51 -0700)
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>
fs/lockd/clntlock.c
fs/lockd/clntproc.c

index ca0a08001449a999e7070253ba51f7607291285e..193f04cc97ba9c8374fcca8fb6adcd4fb12fa3c0 100644 (file)
@@ -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;
 }
index a3a09877ea6212ad9ccc36504536262734a13dfa..8392cb85bd54401d27028f0ed2932dceb4dd98bf 100644 (file)
@@ -551,9 +551,6 @@ 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;
        }