linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Possible NFSv4 locking bug
@ 2011-02-28 15:27 Rick Koshi
  2011-03-01 15:53 ` J. Bruce Fields
  0 siblings, 1 reply; 9+ messages in thread
From: Rick Koshi @ 2011-02-28 15:27 UTC (permalink / raw)
  To: linux-nfs


Hi all, I hope this is the right place for this.

I'm using NFSv4, server and client both running 2.6.36.

I've found that when I lock an NFS-mounted file on a client, the server
reserves an open file descriptor (as seen in /proc/sys/fs/file-nr).
The server never releases this descriptor, even if the client process
explictly releases the lock or exits.

In my case, I noticed this because I have a monitoring process which
runs every 5 seconds and runs 'rrdtool' to log some status to a file
on an NFS-mounted filesystem.  This allocated 720 files per hour, and
eventually caused my server to run out of file descriptors and become
unusable.  I experimented with a test program, and found that it's the
fcntl64(3, F_SETLK, {type=F_WRLCK, ...}) system call that triggers
the behavior, and that unlocking the file explictly doesn't help.

Stopping the NFS service (including the lockd) does not release the
open files.  Only rebooting resets the state.

I'm no kernel expert.  Perhaps you can tell me if this is a necessary
side effect of some part of the NFS implementation.  But to me, it looks
like a bug.

Thanks for your time,

    -- Koshi

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Possible NFSv4 locking bug
@ 2011-03-06 17:34 Ivo Přikryl
  0 siblings, 0 replies; 9+ messages in thread
From: Ivo Přikryl @ 2011-03-06 17:34 UTC (permalink / raw)
  To: linux-nfs

Hi, 

I have the same problem as discussed here and in 
http://serverfault.com/questions/235059/vfs-file-max-limit-1231582-reached
Would be more than happy to help testing. 

I  have spare server ready and I am now compiling kernel 2.6.38 RC3 patched with your patch. 

Will let you know how did it work out. 

Regards
-- 
****************************************
Ivo Přikryl
prikryl@eurosat.cz
EuroSat cs spol.s r.o.
www.eurosat.cz
*****************************************

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Possible NFSv4 locking bug
@ 2011-03-06 23:59 Ivo Přikryl
  2011-03-07 18:21 ` J. Bruce Fields
  0 siblings, 1 reply; 9+ messages in thread
From: Ivo Přikryl @ 2011-03-06 23:59 UTC (permalink / raw)
  To: linux-nfs

Hello, 

just booted MDV 2010.2 with custom build 2.6.38 RC3 kernel, NFS4 server patched with your patch. 
So far it seems to be running just fine. No file descriptor wasted..

server#cat /proc/sys/fs/file-nr
960     0       1231794

I will give it more time to observe..


I can also confirm, that before it was impossible to umount the volume after file descriptors leakage. 
If you want me to test anything regarding this issue, I have system ready.

Thanks again 

Regards 
Ivo 
-- 
****************************************
Ivo Přikryl
prikryl@eurosat.cz
EuroSat cs spol.s r.o.
www.eurosat.cz
*****************************************

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-03-07 18:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-28 15:27 Possible NFSv4 locking bug Rick Koshi
2011-03-01 15:53 ` J. Bruce Fields
2011-03-01 22:31   ` Rick Koshi
2011-03-02 19:15     ` J. Bruce Fields
2011-03-03  6:20       ` J. Bruce Fields
2011-03-04 14:16         ` Rick Koshi
  -- strict thread matches above, loose matches on Subject: below --
2011-03-06 17:34 Ivo Přikryl
2011-03-06 23:59 Ivo Přikryl
2011-03-07 18:21 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).