linux-imx/fs/nfsd
NeilBrown e0aeb26b04 NFSD: simplify error paths in nfsd_svc()
commit bf32075256 upstream.

The error paths in nfsd_svc() are needlessly complex and can result in a
final call to svc_put() without nfsd_last_thread() being called.  This
results in the listening sockets not being closed properly.

The per-netns setup provided by nfsd_startup_new() and removed by
nfsd_shutdown_net() is needed precisely when there are running threads.
So we don't need nfsd_up_before.  We don't need to know if it *was* up.
We only need to know if any threads are left.  If none are, then we must
call nfsd_shutdown_net().  But we don't need to do that explicitly as
nfsd_last_thread() does that for us.

So simply call nfsd_last_thread() before the last svc_put() if there are
no running threads.  That will always do the right thing.

Also discard:
 pr_info("nfsd: last server has exited, flushing export cache\n");
It may not be true if an attempt to start the first server failed, and
it isn't particularly helpful and it simply reports normal behaviour.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reported-by: Li Lingfeng <lilingfeng3@huawei.com>
Suggested-by: Li Lingfeng <lilingfeng3@huawei.com>
Tested-by: Li Lingfeng <lilingfeng3@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-29 17:33:58 +02:00
..
acl.h
auth.c cred: get rid of CONFIG_DEBUG_CREDENTIALS 2023-12-20 17:01:51 +01:00
auth.h
blocklayout.c
blocklayoutxdr.c NFSD: da_addr_body field missing in some GETDEVICEINFO replies 2023-08-29 17:45:22 -04:00
blocklayoutxdr.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cache.h nfsd: make all of the nfsd stats per-network namespace 2024-08-19 06:04:23 +02:00
current_stateid.h
export.c NFSD: Fix frame size warning in svc_export_parse() 2024-08-19 06:04:22 +02:00
export.h NFSD: Fix frame size warning in svc_export_parse() 2024-08-19 06:04:22 +02:00
filecache.c nfsd: Handle EOPENSTALE correctly in the filecache 2023-11-20 11:58:52 +01:00
filecache.h
flexfilelayout.c
flexfilelayoutxdr.c NFSD: da_addr_body field missing in some GETDEVICEINFO replies 2023-08-29 17:45:22 -04:00
flexfilelayoutxdr.h
idmap.h
Kconfig
lockd.c
Makefile
netns.h nfsd: make svc_stat per-network namespace instead of global 2024-08-19 06:04:24 +02:00
nfs2acl.c NFSD 6.3 Release Notes 2023-02-22 14:21:40 -08:00
nfs3acl.c
nfs3proc.c nfsd: handle failure to collect pre/post-op attrs more sanely 2023-08-29 17:45:22 -04:00
nfs3xdr.c
nfs4acl.c
nfs4callback.c
nfs4idmap.c
nfs4layouts.c
nfs4proc.c nfsd: make all of the nfsd stats per-network namespace 2024-08-19 06:04:23 +02:00
nfs4recover.c
nfs4state.c nfsd: make all of the nfsd stats per-network namespace 2024-08-19 06:04:23 +02:00
nfs4xdr.c NFSD: Fix zero NFSv4 READ results when RQ_SPLICE_OK is not set 2023-09-28 10:34:28 -04:00
nfscache.c nfsd: make all of the nfsd stats per-network namespace 2024-08-19 06:04:23 +02:00
nfsctl.c nfsd: make svc_stat per-network namespace instead of global 2024-08-19 06:04:24 +02:00
nfsd.h nfsd: remove nfsd_stats, make th_cnt a global counter 2024-08-19 06:04:24 +02:00
nfsfh.c nfsd: make all of the nfsd stats per-network namespace 2024-08-19 06:04:23 +02:00
nfsfh.h
nfsproc.c
nfssvc.c NFSD: simplify error paths in nfsd_svc() 2024-08-29 17:33:58 +02:00
nfsxdr.c
pnfs.h
state.h
stats.c nfsd: make svc_stat per-network namespace instead of global 2024-08-19 06:04:24 +02:00
stats.h nfsd: make svc_stat per-network namespace instead of global 2024-08-19 06:04:24 +02:00
trace.c
trace.h NFSD: Fix nfsd_clid_class use of __string_len() macro 2024-04-03 15:28:35 +02:00
vfs.c nfsd: make all of the nfsd stats per-network namespace 2024-08-19 06:04:23 +02:00
vfs.h nfsd: Handle EOPENSTALE correctly in the filecache 2023-11-20 11:58:52 +01:00
xdr.h
xdr3.h
xdr4.h
xdr4cb.h