Commit fa16ac16 authored by Stanislav Kinsbursky's avatar Stanislav Kinsbursky Committed by Greg Kroah-Hartman

nfsd: pass proper net to nfsd_destroy() from NFSd kthreads

commit 88c47666 upstream.

Since NFSd service is per-net now, we have to pass proper network
context in nfsd_shutdown() from NFSd kthreads.

The simplest way I found is to get proper net from one of transports
with permanent sockets.
Signed-off-by: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
[wengmeiling: backport to 3.4: adjust context]
Signed-off-by: default avatarWeng Meiling <wengmeiling.weng@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7bdac1ec
......@@ -483,6 +483,8 @@ static int
nfsd(void *vrqstp)
{
struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp;
struct svc_xprt *perm_sock = list_entry(rqstp->rq_server->sv_permsocks.next, typeof(struct svc_xprt), xpt_list);
struct net *net = perm_sock->xpt_net;
int err, preverr = 0;
/* Lock module and set up kernel thread */
......@@ -557,7 +559,7 @@ nfsd(void *vrqstp)
/* Release the thread */
svc_exit_thread(rqstp);
nfsd_destroy(&init_net);
nfsd_destroy(net);
/* Release module */
mutex_unlock(&nfsd_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment