Skip to content

Commit 53e4e17

Browse files
neilbrownchucklever
authored andcommitted
nfsd: nfsd_destroy_serv() must call svc_destroy() even if nfsd_startup_net() failed
If nfsd_startup_net() fails and so ->nfsd_net_up is false, nfsd_destroy_serv() doesn't currently call svc_destroy(). It should. Fixes: 1e3577a ("SUNRPC: discard sv_refcnt, and svc_get/svc_put") Signed-off-by: NeilBrown <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent dc0d0f8 commit 53e4e17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/nfsd/nfssvc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ static void nfsd_shutdown_net(struct net *net)
385385
{
386386
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
387387

388+
if (!nn->nfsd_net_up)
389+
return;
390+
nfsd_export_flush(net);
388391
nfs4_state_shutdown_net(net);
389392
nfsd_reply_cache_shutdown(nn);
390393
nfsd_file_cache_shutdown_net(net);
@@ -492,11 +495,8 @@ void nfsd_destroy_serv(struct net *net)
492495
* other initialization has been done except the rpcb information.
493496
*/
494497
svc_rpcb_cleanup(serv, net);
495-
if (!nn->nfsd_net_up)
496-
return;
497498

498499
nfsd_shutdown_net(net);
499-
nfsd_export_flush(net);
500500
svc_destroy(&serv);
501501
}
502502

0 commit comments

Comments
 (0)