Skip to content

Commit

Permalink
nfsd: pass proper net to nfsd_destroy() from NFSd kthreads
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stanislav Kinsbursky authored and J. Bruce Fields committed Dec 10, 2012
1 parent 541e864 commit 88c4766
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/nfsd/nfssvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -605,7 +607,7 @@ nfsd(void *vrqstp)
/* Release the thread */
svc_exit_thread(rqstp);

nfsd_destroy(&init_net);
nfsd_destroy(net);

/* Release module */
mutex_unlock(&nfsd_mutex);
Expand Down

0 comments on commit 88c4766

Please sign in to comment.