nfsd: ensure sockets are closed on error
authorNeil Brown <neilb@suse.de>
Mon, 1 Mar 2010 03:01:05 +0000 (22:01 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:41:35 +0000 (07:41 -0700)
commit47395d161480e6c91b40623a55097b92db026f0f
treeae350afcc486705a9446f2432791951bb7e1298d
parentaf455ed731b0d263fbe2bf79dddf89fb1a2bc66b
nfsd: ensure sockets are closed on error

commit 301e99ce4a2f42a317129230fd42e6cd874c64b0 upstream.

One the changes in commit d7979ae4a "svc: Move close processing to a
single place" is:

  err_delete:
-       svc_delete_socket(svsk);
+       set_bit(SK_CLOSE, &svsk->sk_flags);
        return -EAGAIN;

This is insufficient. The recvfrom methods must always call
svc_xprt_received on completion so that the socket gets re-queued if
there is any more work to do.  This particular path did not make that
call because it actually destroyed the svsk, making requeue pointless.
When the svc_delete_socket was change to just set a bit, we should have
added a call to svc_xprt_received,

This is the problem that b0401d7253 attempted to fix, incorrectly.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/sunrpc/svcsock.c