Skip to content

Commit

Permalink
nfsd: nfsd_destroy_serv() must call svc_destroy() even if nfsd_startu…
Browse files Browse the repository at this point in the history
…p_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 <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
  • Loading branch information
NeilBrown authored and Chuck Lever committed Sep 23, 2024
1 parent dc0d0f8 commit 53e4e17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/nfsd/nfssvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ static void nfsd_shutdown_net(struct net *net)
{
struct nfsd_net *nn = net_generic(net, nfsd_net_id);

if (!nn->nfsd_net_up)
return;
nfsd_export_flush(net);
nfs4_state_shutdown_net(net);
nfsd_reply_cache_shutdown(nn);
nfsd_file_cache_shutdown_net(net);
Expand Down Expand Up @@ -492,11 +495,8 @@ void nfsd_destroy_serv(struct net *net)
* other initialization has been done except the rpcb information.
*/
svc_rpcb_cleanup(serv, net);
if (!nn->nfsd_net_up)
return;

nfsd_shutdown_net(net);
nfsd_export_flush(net);
svc_destroy(&serv);
}

Expand Down

0 comments on commit 53e4e17

Please sign in to comment.