diff options
author | J. Bruce Fields <bfields@redhat.com> | 2013-02-10 16:08:11 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-02-17 10:53:51 -0500 |
commit | cc630d9f476445927fca599f81182c7f06f79058 (patch) | |
tree | 3b7f67264ba2868ed4921a86af9b5d266e6019ed /net/sunrpc/svc.c | |
parent | e75bafbff2270993926abcc31358361db74a9bc2 (diff) |
svcrpc: fix rpc server shutdown races
Rewrite server shutdown to remove the assumption that there are no
longer any threads running (no longer true, for example, when shutting
down the service in one network namespace while it's still running in
others).
Do that by doing what we'd do in normal circumstances: just CLOSE each
socket, then enqueue it.
Since there may not be threads to handle the resulting queued xprts,
also run a simplified version of the svc_recv() loop run by a server to
clean up any closed xprts afterwards.
Cc: stable@kernel.org
Tested-by: Jason Tibbitts <tibbs@math.uh.edu>
Tested-by: Paweł Sikora <pawel.sikora@agmk.net>
Acked-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/svc.c')
-rw-r--r-- | net/sunrpc/svc.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index b9ba2a8c1c1..89a588b4478 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -515,15 +515,6 @@ EXPORT_SYMBOL_GPL(svc_create_pooled); void svc_shutdown_net(struct svc_serv *serv, struct net *net) { - /* - * The set of xprts (contained in the sv_tempsocks and - * sv_permsocks lists) is now constant, since it is modified - * only by accepting new sockets (done by service threads in - * svc_recv) or aging old ones (done by sv_temptimer), or - * configuration changes (excluded by whatever locking the - * caller is using--nfsd_mutex in the case of nfsd). So it's - * safe to traverse those lists and shut everything down: - */ svc_close_net(serv, net); if (serv->sv_shutdown) |