NFS locking: lockf freezes (rpc.lockd problem?)

Michael Abbott michael at araneidae.co.uk
Sun Aug 27 11:24:19 UTC 2006


I've been trying to make some sense of the "NFS locking" issue.  I am 
trying to run
 	# make installworld DESTDIR=/mnt
where /mnt is an NFS mount on a FreeBSD 4.11 server, but I am unable to 
get past a call to `lockf`.

On this mailing list I've seen a thread starting with this message:
 	http://lists.freebsd.org/pipermail/freebsd-stable/2006-August/027561.html
and elsewhere I've seen this thread:
 	http://www.gatago.com/mpc/lists/freebsd/stable/21851805.html

The gist seems to be that rpc.lockd is badly behaved and broken and nobody 
knows how to fix it.  So, in case my experience is any help, here is what 
I can report.

1.  I have installed a fresh installation of FreeBSD 6.1 from the CD, 
6.1-RELEASE-i386-disc1.iso, and have run `cd /usr/src; make buildworld; 
make buildkernel` successfully (takes nearly 8 hours, but then it is a 
fanless machine).  The full distribution (as installed by sysinstall) is 
present, but nothing else.

2.  Intending to experiment with network booting, I've attempted
`make installworld DESTDIR=/mnt`, where /mnt is an NFS mount point on my 
master server, running FreeBSD 4.11-RELEASE-p11.

3.  This fails when invoking lockf.  To work around this, I have started 
rpc.lockd on the 4.11 server and configured all of the following lines in 
rc.conf:
 	rpcbind_enable="YES"
 	nfs_client_enable="YES"
 	rpc_lockd_enable="YES"
 	rpc_statd_enable="YES"

4.  Now here is the behaviour:

 	# mount $MY_SERVER:$MY_PATH /mnt
 	# lockf /mnt/test ls
This works just fine
 	# cd /usr/src; make installworld DESTDIR=/mnt
This hangs in lockf, and is unkillable (even `kill -9` is no good, and ps 
shows state = D+).  So let's start another shell (Alt-F2):
 	# lockf /mnt/test ls
Also hangs.

Rebooting the test machine clears the problem, returning to the state at 
the start of point (4), and the problem is completely repeatable in my 
configuration.


Some observations:

  - Hanging in "uninterruptible sleep" is not good.  No doubt it's quite 
possible that my 4.11 server has a broken rpc.lockd (or maybe I've not 
configured it right: I just started rpc.lockd, rather than restarting the 
server), but the behaviour of 6.1 is exceptionally unfriendly.  In 
particular, unkillable processes look like outright bugs to me.

  - The conversation on mpc.lists.freebsd.stable (and elsewhere) looks 
alarming.  I get the impression that this part of FreeBSD 6.1 is really 
rather broken and that there's no real sense of what to do about it.


I hope I've sent this mail to the right place and that it's of some help.


More information about the freebsd-stable mailing list