[PATCH] nlm: fix f_count leak

Linux Kernel Mailing List <[email protected]> Thu, 24 Mar 2005 12:00:05 +0000
Newsgroups gmane.linux.kernel.commits.2-4
Message-ID <[email protected]>
ChangeSet 1.1470, 2005/03/24 09:00:05-03:00, [email protected]

	[PATCH] nlm: fix f_count leak
	
	 The following patch is probably appropriate for 2.4.30.  The problem
	it fixes is not a major one (no security or data corruption issues)
	but is an occasional annoyance, and the fix is trivial (and tested).
	
	### Comments for Changeset
	
	I can't see any reason for this file->f_count++.  Removing it fixes a
	bug which leaves an exported filesystem busy (and so unmountable) if a
	callback for a lock held on that filesystem ever failed.
	
	Found by Terence Rokop.
	
	Signed-off-by: J. Bruce Fields <[email protected]>
	Signed-off-by: Neil Brown <[email protected]>



 svclock.c |    1 -
 1 files changed, 1 deletion(-)


diff -Nru a/fs/lockd/svclock.c b/fs/lockd/svclock.c
--- a/fs/lockd/svclock.c	2005-03-24 09:05:48 -08:00
+++ b/fs/lockd/svclock.c	2005-03-24 09:05:48 -08:00
@@ -640,7 +640,6 @@
 		} else {
 			/* Lock is now held by client, or has been rejected.
 			 * In both cases, the block should be removed. */
-			file->f_count++;
 			up(&file->f_sema);
 			if (status == NLM_LCK_GRANTED)
 				nlmsvc_delete_block(block, 0);