2005-03-23 03:19:10

by NeilBrown

[permalink] [raw]
Subject: [PATCH kNFSd ] nlm: fix f_count leak

Hi,
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).

NeilBrown


### 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]>

### Diffstat output
./fs/lockd/svclock.c | 1 -
1 files changed, 1 deletion(-)

diff ./fs/lockd/svclock.c~current~ ./fs/lockd/svclock.c
--- ./fs/lockd/svclock.c~current~ 2005-03-23 11:28:56.000000000 +1100
+++ ./fs/lockd/svclock.c 2005-03-23 11:29:02.000000000 +1100
@@ -640,7 +640,6 @@ nlmsvc_grant_reply(struct svc_rqst *rqst
} 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);


-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2005-03-26 00:38:45

by Marcelo Tosatti

[permalink] [raw]
Subject: Re: [PATCH kNFSd ] nlm: fix f_count leak

On Wed, Mar 23, 2005 at 02:18:39PM +1100, NeilBrown wrote:
> Hi,
> 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).

Applied, thanks Neil.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs