kernel-hacking-2024-linux-s.../fs/nfs
NeilBrown 3391fc92db sunrpc: allow svc threads to fail initialisation cleanly
If an svc thread needs to perform some initialisation that might fail,
it has no good way to handle the failure.

Before the thread can exit it must call svc_exit_thread(), but that
requires the service mutex to be held.  The thread cannot simply take
the mutex as that could deadlock if there is a concurrent attempt to
shut down all threads (which is unlikely, but not impossible).

nfsd currently call svc_exit_thread() unprotected in the unlikely event
that unshare_fs_struct() fails.

We can clean this up by introducing svc_thread_init_status() by which an
svc thread can report whether initialisation has succeeded.  If it has,
it continues normally into the action loop.  If it has not,
svc_thread_init_status() immediately aborts the thread.
svc_start_kthread() waits for either of these to happen, and calls
svc_exit_thread() (under the mutex) if the thread aborted.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2024-09-20 19:31:03 -04:00
..
blocklayout nfs/blocklayout: add support for NVMe 2024-07-12 11:35:50 -04:00
filelayout nfs: remove dead code for the old swap over NFS implementation 2024-07-08 13:47:51 -04:00
flexfilelayout NFSv4/pNFS: Do layout state recovery upon reboot 2024-07-08 13:47:26 -04:00
cache_lib.c
cache_lib.h
callback.c sunrpc: allow svc threads to fail initialisation cleanly 2024-09-20 19:31:03 -04:00
callback.h NFSv4: Add CB_GETATTR support for delegated attributes 2024-07-08 13:47:25 -04:00
callback_proc.c pNFS: Add a flag argument to pnfs_destroy_layouts_byclid() 2024-07-08 13:47:26 -04:00
callback_xdr.c nfs: fix bitmap decoder to handle a 3rd word 2024-08-22 17:01:10 -04:00
client.c nfs: Block on write congestion 2024-07-08 13:47:27 -04:00
delegation.c NFS: Avoid unnecessary rescanning of the per-server delegation list 2024-08-22 17:01:10 -04:00
delegation.h NFSv4: Delegreturn must set m/atime when they are delegated 2024-07-08 13:47:25 -04:00
dir.c NFSv4: Add a flags argument to the 'have_delegation' callback 2024-07-08 13:47:25 -04:00
direct.c nfs: drop the incorrect assertion in nfs_swap_rw() 2024-06-24 20:52:11 -07:00
dns_resolve.c
dns_resolve.h
export.c
file.c - 875fa64577da ("mm/hugetlb_vmemmap: fix race with speculative PFN 2024-07-21 17:15:46 -07:00
fs_context.c
fscache.c 9p: Fix DIO read through netfs 2024-08-13 13:53:09 +02:00
fscache.h netfs: Fix handling of USE_PGPRIV2 and WRITE_TO_CACHE flags 2024-08-12 22:03:27 +02:00
getroot.c
inode.c NFSv4: Fix up delegated attributes in nfs_setattr 2024-07-08 13:47:25 -04:00
internal.h nfs: remove nfs_page_length 2024-07-10 13:28:06 -04:00
io.c
iostat.h mm: add comments for allocation helpers explaining why they are macros 2024-07-12 15:52:20 -07:00
Kconfig
Makefile
mount_clnt.c NFS: remove unused struct 'mnt_fhstatus' 2024-07-08 13:47:24 -04:00
namespace.c
netns.h
nfs.h
nfs2super.c fs: nfs: add missing MODULE_DESCRIPTION() macros 2024-07-08 13:47:24 -04:00
nfs2xdr.c
nfs3_fs.h
nfs3acl.c
nfs3client.c
nfs3proc.c Return the delegation when deleting sillyrenamed files 2024-07-08 13:47:26 -04:00
nfs3super.c fs: nfs: add missing MODULE_DESCRIPTION() macros 2024-07-08 13:47:24 -04:00
nfs3xdr.c
nfs4_fs.h NFSv4.1: constify the stateid argument in nfs41_test_stateid() 2024-07-08 13:47:26 -04:00
nfs4client.c NFSv4.1 another fix for EXCHGID4_FLAG_USE_PNFS_DS for DS server 2024-07-08 13:47:27 -04:00
nfs4file.c
nfs4getroot.c
nfs4idmap.c
nfs4idmap.h
nfs4namespace.c
nfs4proc.c NFSv4: Fix clearing of layout segments in layoutreturn 2024-08-22 17:01:10 -04:00
nfs4renewd.c
nfs4session.c
nfs4session.h
nfs4state.c NFSv4/pNFS: Do layout state recovery upon reboot 2024-07-08 13:47:26 -04:00
nfs4super.c fs: nfs: add missing MODULE_DESCRIPTION() macros 2024-07-08 13:47:24 -04:00
nfs4sysctl.c
nfs4trace.c nfs/blocklayout: SCSI layout trace points for reservation key reg/unreg 2024-07-08 13:47:27 -04:00
nfs4trace.h nfs/blocklayout: SCSI layout trace points for reservation key reg/unreg 2024-07-08 13:47:27 -04:00
nfs4xdr.c NFSv4: Clean up encode_nfs4_stateid() 2024-07-08 13:47:26 -04:00
nfs42.h
nfs42proc.c
nfs42xattr.c
nfs42xdr.c
nfsroot.c
nfstrace.c
nfstrace.h nfs: pass explicit offset/count to trace events 2024-07-17 13:15:35 -04:00
pagelist.c nfs: move nfs_wait_on_request to write.c 2024-07-08 13:47:51 -04:00
pnfs.c NFSv4: Fix clearing of layout segments in layoutreturn 2024-08-22 17:01:10 -04:00
pnfs.h nfs: remove the unused max_deviceinfo_size field from struct pnfs_layoutdriver_type 2024-07-10 13:23:17 -04:00
pnfs_dev.c nfs: remove the unused max_deviceinfo_size field from struct pnfs_layoutdriver_type 2024-07-10 13:23:17 -04:00
pnfs_nfs.c nfs: remove dead code for the old swap over NFS implementation 2024-07-08 13:47:51 -04:00
proc.c Return the delegation when deleting sillyrenamed files 2024-07-08 13:47:26 -04:00
read.c NFS Client Updates for Linux 6.11 2024-07-18 17:17:30 -07:00
super.c NFSv4: Add missing rescheduling points in nfs_client_return_marked_delegations 2024-08-22 17:01:10 -04:00
symlink.c nfs: Remove calls to folio_set_error 2024-05-31 12:31:41 +02:00
sysctl.c
sysfs.c
sysfs.h
unlink.c Return the delegation when deleting sillyrenamed files 2024-07-08 13:47:26 -04:00
write.c - 875fa64577da ("mm/hugetlb_vmemmap: fix race with speculative PFN 2024-07-21 17:15:46 -07:00