Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 6167 - NFS fcntl() locking hangs client
Summary: NFS fcntl() locking hangs client
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Brad Cowan (RETIRED)
URL:
Whiteboard:
Keywords:
: 6433 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-08-07 11:42 UTC by Chris Paulson-Ellis
Modified: 2003-02-04 19:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Paulson-Ellis 2002-08-07 11:42:42 UTC
I have a machine with very little disk space (I've already 
deleted /usr/lib/locale :-). On this machine, I mount /var/tmp/portage from a 
server, as building most things takes *much* more space than I have locally. 
When emerging perl, configure hangs when running the following test code...

#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
int main() {
#if defined(F_SETLK) && defined(F_SETLKW)
     struct flock flock;
     int retval, fd;
     fd = open("try.c", O_RDONLY);
     flock.l_type = F_RDLCK;
     flock.l_whence = SEEK_SET;
     flock.l_start = flock.l_len = 0;
     retval = fcntl(fd, F_SETLK, &flock);
     close(fd);
     (retval < 0 ? exit(2) : exit(0));
#else
     exit(2);
#endif
}

If I run this program (called try) after copying it (and try.c) to the 
local /tmp, it doesn't hang. If I run the program using strace, I can see that 
it's hanging in the fcntl() call (the actual system call is fcntl64).

I'm sure this is a problem with the NFS server (another Gentoo box). The 
rpc.lockd program, which handles locking, is not running, but the manual page 
claims that the server should run it when neccessary. If you try to run it by 
hand anyway, it just exits. I expect the problem is a Linux kernel bug which 
Gentoo doesn't have a patch for. A quick google search revealed hints that 
there have been some recent problems in this area.

My NFS server is compiled into the kernel, with NFSv3 enabled. The kernel is 
2.4.19-gentoo-r7.

Chris.
Comment 1 SpanKY gentoo-dev 2002-08-08 00:16:33 UTC
do you have any grsec options enabled ?
ive seen a msg or 2 about people talking of weird nfs behavior w/certain grsec 
options turned on
Comment 2 Chris Paulson-Ellis 2002-08-08 04:15:43 UTC
No. None of the grsecurity stuff is enabled in the client or server kernels.
Comment 3 SpanKY gentoo-dev 2002-08-13 23:29:17 UTC
*** Bug 6433 has been marked as a duplicate of this bug. ***
Comment 4 Brad Cowan (RETIRED) gentoo-dev 2002-10-22 04:33:36 UTC
This bug is rather old, still having this problem? tried emergeing the newest
nfs-utils I committed to portage?
THX
Comment 5 Chris Paulson-Ellis 2002-10-22 04:47:46 UTC
I've updated the server kernel (but not the client) to 2.4.19-gentoo-r9 and the 
problem seems to have gone away. The server will also have had nfs-utils 
updated as time passed (it's currently at 0.3.3-r1), so I'm not sure if the 
kernel update or the nfs-utils update is responsible for the fix.

I'm doing some stress tests right now. I'll let you know how it goes.

Chris.