From 5996a298da43a03081e9ba2116983d173001c862 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Tue, 3 Jan 2006 09:55:44 +0100 Subject: NLM: don't unlock on cancel requests Currently when lockd gets an NLM_CANCEL request, it also does an unlock for the same range. This is incorrect. The Open Group documentation says that "This procedure cancels an *outstanding* blocked lock request." (Emphasis mine.) Also, consider a client that holds a lock on the first byte of a file, and requests a lock on the entire file. If the client cancels that request (perhaps because the requesting process is signalled), the server shouldn't apply perform an unlock on the entire file, since that will also remove the previous lock that the client was already granted. Or consider a lock request that actually *downgraded* an exclusive lock to a shared lock. Signed-off-by: J. Bruce Fields Signed-off-by: Trond Myklebust --- fs/lockd/svclock.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'fs/lockd/svclock.c') diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index e42f0cc6c45..5fb48b4390b 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -240,11 +240,6 @@ nlmsvc_delete_block(struct nlm_block *block, int unlock) nlmsvc_remove_block(block); 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. */ -- cgit v1.2.3