]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
nfsd: pass proper net to nfsd_destroy() from NFSd kthreads
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Thu, 6 Dec 2012 15:34:42 +0000 (18:34 +0300)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 10 Dec 2012 21:25:42 +0000 (16:25 -0500)
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: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfssvc.c

index 2cfd9c69503e13c2b315ee43a7e38a7eb3c42cac..cee62ab9d4a30f84fe05d871409f064f24350b07 100644 (file)
@@ -541,6 +541,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;
 
        /* Lock module and set up kernel thread */
@@ -605,7 +607,7 @@ out:
        /* Release the thread */
        svc_exit_thread(rqstp);
 
-       nfsd_destroy(&init_net);
+       nfsd_destroy(net);
 
        /* Release module */
        mutex_unlock(&nfsd_mutex);