]> git.baikalelectronics.ru Git - kernel.git/commit
NFSD: Fix BUG during NFSD shutdown processing
authorChuck Lever <chuck.lever@oracle.com>
Wed, 22 Oct 2008 17:12:36 +0000 (13:12 -0400)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Wed, 22 Oct 2008 17:36:05 +0000 (13:36 -0400)
commit8607d229ebccf1b991962d4e3ab2ccf9a2c92de0
tree1b2f43ddc4d22089de09b949442f4b46663e3949
parent2a2f499c53bfd1c60f16680713b6739ab77b20cb
NFSD: Fix BUG during NFSD shutdown processing

The Linux NFS server can be started via a user-space write to
/proc/fs/nfs/threads or to /proc/fs/nfs/portlist.  In the first case,
all default listeners are started (both UDP and TCP).  In the second,
a listener is started only for one specified transport.

The NFS server has to make sure lockd stays up until the last listener
transport goes away.  To support both start-up interfaces, it should
do one lockd_up() for each NFSD listener.

The nfsd_init_socks() function used to do one lockd_up() call for each
svc_create_xprt().  Recently commit
7095a7730ab245da6f4c1b54d820a5c69a9cca10 mistakenly changed
nfsd_init_socks() to do only one lockd_up() call even though it still
does two svc_create_xprt() calls.

The end result is a lockd_down() BUG during NFSD shutdown processing
because nfsd_last_threads() does a lockd_down() call for each entry
on the sv_permsocks list, but the start-up code doesn't do a matching
number of lockd_up() calls.

Add a second lockd_up() in nfsd_init_socks() to make sure the number
of lockd_up() calls matches the number of entries on the NFS servers's
sv_permsocks list.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfssvc.c