Unverified Commit fdb298b7 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11321 NFSD: simplify error paths in nfsd_svc()

parents f0a01ebf 713e577d
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -567,7 +567,6 @@ void nfsd_last_thread(struct net *net)
		return;

	nfsd_shutdown_net(net);
	pr_info("nfsd: last server has exited, flushing export cache\n");
	nfsd_export_flush(net);
}

@@ -783,7 +782,6 @@ int
nfsd_svc(int nrservs, struct net *net, const struct cred *cred)
{
	int	error;
	bool	nfsd_up_before;
	struct nfsd_net *nn = net_generic(net, nfsd_net_id);
	struct svc_serv *serv;

@@ -803,8 +801,6 @@ nfsd_svc(int nrservs, struct net *net, const struct cred *cred)
	error = nfsd_create_serv(net);
	if (error)
		goto out;

	nfsd_up_before = nn->nfsd_net_up;
	serv = nn->nfsd_serv;

	error = nfsd_startup_net(net, cred);
@@ -812,17 +808,15 @@ nfsd_svc(int nrservs, struct net *net, const struct cred *cred)
		goto out_put;
	error = svc_set_num_threads(serv, NULL, nrservs);
	if (error)
		goto out_shutdown;
		goto out_put;
	error = serv->sv_nrthreads;
	if (error == 0)
		nfsd_last_thread(net);
out_shutdown:
	if (error < 0 && !nfsd_up_before)
		nfsd_shutdown_net(net);
out_put:
	/* Threads now hold service active */
	if (xchg(&nn->keep_active, 0))
		svc_put(serv);

	if (serv->sv_nrthreads == 0)
		nfsd_last_thread(net);
	svc_put(serv);
out:
	mutex_unlock(&nfsd_mutex);