Commit 88c47666171989ed4c5b1a5687df09511e8c5e35
Committed by
J. Bruce Fields
1 parent
541e864f00
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
nfsd: pass proper net to nfsd_destroy() from NFSd kthreads
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>
Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff
fs/nfsd/nfssvc.c
... | ... | @@ -541,6 +541,8 @@ |
541 | 541 | nfsd(void *vrqstp) |
542 | 542 | { |
543 | 543 | struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp; |
544 | + struct svc_xprt *perm_sock = list_entry(rqstp->rq_server->sv_permsocks.next, typeof(struct svc_xprt), xpt_list); | |
545 | + struct net *net = perm_sock->xpt_net; | |
544 | 546 | int err; |
545 | 547 | |
546 | 548 | /* Lock module and set up kernel thread */ |
... | ... | @@ -605,7 +607,7 @@ |
605 | 607 | /* Release the thread */ |
606 | 608 | svc_exit_thread(rqstp); |
607 | 609 | |
608 | - nfsd_destroy(&init_net); | |
610 | + nfsd_destroy(net); | |
609 | 611 | |
610 | 612 | /* Release module */ |
611 | 613 | mutex_unlock(&nfsd_mutex); |