]> git.neil.brown.name Git - history.git/commitdiff
NLM: Fix a bug which causes a newly granted lock to be
authorTrond Myklebust <trond.myklebust@fys.uio.no>
Mon, 23 Aug 2004 14:00:36 +0000 (10:00 -0400)
committerTrond Myklebust <trond.myklebust@fys.uio.no>
Mon, 23 Aug 2004 14:00:36 +0000 (10:00 -0400)
   immediately unlocked on the server side if blocking
   has occurred.

Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no>
fs/lockd/svclock.c

index b85d721172599f9c58fdc3b299af998a68775b46..d47e8aa128a0ca5a3b1696f507b54dad27b9fc68 100644 (file)
@@ -238,8 +238,13 @@ nlmsvc_delete_block(struct nlm_block *block, int unlock)
 
        /* Remove block from list */
        nlmsvc_remove_block(block);
-       posix_unblock_lock(file->f_file, fl);
-       block->b_granted = 0;
+       if (fl->fl_next)
+               posix_unblock_lock(file->f_file, fl);
+       if (unlock) {
+               fl->fl_type = F_UNLCK;
+               posix_lock_file(file->f_file, fl);
+               block->b_granted = 0;
+       }
 
        /* If the block is in the middle of a GRANT callback,
         * don't kill it yet. */