kernel_samsung_a53x/fs/nfsd
NeilBrown 3890c7c53c NFSD: simplify error paths in nfsd_svc()
[ Upstream commit bf32075256e9dd9c6b736859e2c5813981339908 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-23 23:21:01 +01:00
..
acl.h
auth.c
auth.h
blocklayout.c
blocklayoutxdr.c
blocklayoutxdr.h
cache.h nfsd: move init of percpu reply_cache_stats counters back to nfsd_init_net 2024-11-23 23:21:01 +01:00
current_stateid.h
export.c
export.h
fault_inject.c
filecache.c NFSD: Fix problem of COMMIT and NFS4ERR_DELAY in infinite loop 2024-11-19 12:28:32 +01:00
filecache.h NFSD: Convert filecache to rhltable 2024-11-19 12:28:32 +01:00
flexfilelayout.c
flexfilelayoutxdr.c
flexfilelayoutxdr.h
idmap.h
Kconfig
lockd.c
Makefile
netns.h
nfs2acl.c
nfs3acl.c
nfs3proc.c
nfs3xdr.c
nfs4acl.c
nfs4callback.c
nfs4idmap.c
nfs4layouts.c
nfs4proc.c nfsd: Fix a regression in nfsd_setattr() 2024-11-19 12:28:33 +01:00
nfs4recover.c
nfs4state.c nfsd: hold a lighter-weight client reference over CB_RECALL_ANY 2024-11-19 14:19:31 +01:00
nfs4xdr.c nfsd: Fix creation time serialization order 2024-11-19 12:28:32 +01:00
nfscache.c NFSD: Refactor the duplicate reply cache shrinker 2024-11-23 23:21:01 +01:00
nfsctl.c nfsd: move init of percpu reply_cache_stats counters back to nfsd_init_net 2024-11-23 23:21:01 +01:00
nfsd.h nfsd: drop the nfsd_put helper 2024-11-19 12:28:33 +01:00
nfsfh.c
nfsfh.h
nfsproc.c
nfssvc.c NFSD: simplify error paths in nfsd_svc() 2024-11-23 23:21:01 +01:00
nfsxdr.c
pnfs.h
state.h
stats.c
stats.h
trace.c
trace.h NFSD: Replace nfsd_prune_bucket() 2024-11-23 23:21:01 +01:00
vfs.c Revert "namei: introduce struct renamedata" 2024-11-19 13:45:08 +01:00
vfs.h
xdr.h
xdr3.h
xdr4.h NFSD: enhance inter-server copy cleanup 2024-11-19 12:28:30 +01:00
xdr4cb.h