[PATCH] knfsd: fix recently introduced problem with shutting down a busy NFS server
authorNeilBrown <neilb@suse.de>
Tue, 6 Mar 2007 09:42:22 +0000 (01:42 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 6 Mar 2007 17:30:26 +0000 (09:30 -0800)
commitcda1fd4abd773216a888487af0170d0cc3d50454
treeaed6662bab1789a1698644f2e1d0db4255ecad67
parent5a05ed73e1abfd7e0e7d474817245861deaa18af
[PATCH] knfsd: fix recently introduced problem with shutting down a busy NFS server

When the last thread of nfsd exits, it shuts down all related sockets.  It
currently uses svc_close_socket to do this, but that only is immediately
effective if the socket is not SK_BUSY.

If the socket is busy - i.e.  if a request has arrived that has not yet been
processes - svc_close_socket is not effective and the shutdown process spins.

So create a new svc_force_close_socket which removes the SK_BUSY flag is set
and then calls svc_close_socket.

Also change some open-codes loops in svc_destroy to use
list_for_each_entry_safe.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/sunrpc/svcsock.h
net/sunrpc/svc.c
net/sunrpc/svcsock.c