From d6d6692e789297c147f34fe6d22331cf492c6147 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Mon, 23 Aug 2004 10:00:36 -0400 Subject: [PATCH] NLM: Fix a bug which causes a newly granted lock to be immediately unlocked on the server side if blocking has occurred. Signed-off-by: Trond Myklebust --- fs/lockd/svclock.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index b85d72117259..d47e8aa128a0 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -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. */ -- 2.39.5