RFC: removing shared vnode locks in nfs.

Alfred Perlstein bright at mu.org
Sat Nov 8 13:05:14 PST 2003

I am requesting a second pair of eyes to make sure I can get rid
of shared locks under nfs client.

The reason we have shared vnode locks in FreeBSD for NFS is because
otherwise if a NFS server goes away we race to the root and halt
the whole machine.

However, since rev 1.39 of vfs_lookup.c we avoid this by using an
interlock with vfs_busy() when crossing into a new mountpoint.
Since vfs_busy itself is a shared lock we can have multiple procs
stuck on that file system but they will have dropped the parent
directory lock, so we may wind up with a bunch of blocked processes,
but not a race to root.

FYI, Apple has been using exclusive locks on NFS for over two years
without problems because they have the equivelant of 1.39 in their

- Alfred Perlstein
- Research Engineering Development Inc.
- email: bright at mu.org cell: 408-480-4684

More information about the freebsd-fs mailing list