linux/fs/nfs
NeilBrown 5bab56fff5 NFS: fix disabling of swap
When swap is activated to a file on an NFSv4 mount we arrange that the
state manager thread is always present as starting a new thread requires
memory allocations that might block waiting for swap.

Unfortunately the code for allowing the state manager thread to exit when
swap is disabled was not tested properly and does not work.
This can be seen by examining /proc/fs/nfsfs/servers after disabling swap
and unmounting the filesystem.  The servers file will still list one
entry.  Also a "ps" listing will show the state manager thread is still
present.

There are two problems.
 1/ rpc_clnt_swap_deactivate() doesn't walk up the ->cl_parent list to
    find the primary client on which the state manager runs.

 2/ The thread is not woken up properly and it immediately goes back to
    sleep without checking whether it is really needed.  Using
    nfs4_schedule_state_manager() ensures a proper wake-up.

Reported-by: Olga Kornievskaia <aglo@umich.edu>
Fixes: 4dc73c6791 ("NFSv4: keep state manager thread active if swap is enabled")
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2023-02-15 10:33:00 -05:00
..
blocklayout NFS client updates for Linux 5.20 2022-08-10 14:04:32 -07:00
filelayout pNFS/filelayout: Fix coalescing test for single DS 2022-12-20 12:52:39 -05:00
flexfilelayout cred: Do not default to init_cred in prepare_kernel_cred() 2022-11-01 10:04:52 -07:00
cache_lib.c
cache_lib.h
callback_proc.c pNFS: Avoid a live lock condition in pnfs_update_layout() 2022-06-06 11:53:55 -04:00
callback_xdr.c SUNRPC: Parametrize how much of argsize should be zeroed 2022-09-26 14:02:42 -04:00
callback.c NFSD: Move svc_serv_ops::svo_function into struct svc_serv 2022-02-28 10:26:40 -05:00
callback.h NFSv4.1: Fix uninitialised variable in devicenotify 2022-01-06 14:00:20 -05:00
client.c NFS: Avoid memcpy() run-time warning for struct sockaddr overflows 2022-10-27 15:52:10 -04:00
delegation.c nfs: use locks_inode_context helper 2022-11-30 05:08:10 -05:00
delegation.h NFSv4: Fix delegation return in cases where we have to retry 2021-06-13 19:36:27 -04:00
dir.c NFS: Fix up a sparse warning 2023-01-01 20:17:26 -05:00
direct.c NFS: Clean up O_DIRECT request allocation 2023-02-14 14:22:33 -05:00
dns_resolve.c NFS: Avoid memcpy() run-time warning for struct sockaddr overflows 2022-10-27 15:52:10 -04:00
dns_resolve.h NFS: Avoid memcpy() run-time warning for struct sockaddr overflows 2022-10-27 15:52:10 -04:00
export.c nfs: block notification on fs with its own ->lock 2022-01-08 14:42:01 -05:00
file.c NFS: Enable tracing of nfs_invalidate_folio() and nfs_launder_folio() 2023-02-14 14:22:33 -05:00
fs_context.c nfs: fix possible null-ptr-deref when parsing param 2022-12-06 10:43:24 -05:00
fscache.c use less confusing names for iov_iter direction initializers 2022-11-25 13:01:55 -05:00
fscache.h nfs: Convert to release_folio 2022-05-09 23:12:33 -04:00
getroot.c NFS: Remove the nfs4_label argument from nfs_setsecurity 2021-11-05 14:54:40 -04:00
inode.c NFS: make sure open context mode have FMODE_EXEC when file open for exec 2022-12-06 10:38:38 -05:00
internal.h NFS: Convert buffered writes to use folios 2023-02-14 14:22:32 -05:00
io.c NFS: Fix up incorrect documentation 2021-04-05 09:04:20 -04:00
iostat.h
Kconfig NFSv4.2: Change the default KConfig value for READ_PLUS 2022-12-10 13:24:59 -05:00
Makefile nfs: Convert to new fscache volume/cookie API 2022-01-10 11:53:25 +00:00
mount_clnt.c NFS: Avoid memcpy() run-time warning for struct sockaddr overflows 2022-10-27 15:52:10 -04:00
namespace.c NFS: use sysfs_emit() to instead of scnprintf() 2022-12-06 12:32:37 -05:00
netns.h NFS: Add sysfs support for per-container identifier 2019-07-06 14:54:49 -04:00
nfs2super.c
nfs2xdr.c NFS: Optimise away the previous cookie field 2022-03-02 08:43:39 -05:00
nfs3_fs.h fs: pass dentry to set acl method 2022-10-19 12:55:42 +02:00
nfs3acl.c fs: rename current get acl method 2022-10-20 10:13:27 +02:00
nfs3client.c NFS: Avoid memcpy() run-time warning for struct sockaddr overflows 2022-10-27 15:52:10 -04:00
nfs3proc.c fs: rename current get acl method 2022-10-20 10:13:27 +02:00
nfs3super.c
nfs3xdr.c NFS: Optimise away the previous cookie field 2022-03-02 08:43:39 -05:00
nfs4_fs.h NFS: avoid spurious warning of lost lock that is being unlocked. 2022-12-06 10:45:11 -05:00
nfs4client.c nfs4: Fix kmemleak when allocate slot failed 2022-10-27 15:52:11 -04:00
nfs4file.c NFS: make sure open context mode have FMODE_EXEC when file open for exec 2022-12-06 10:38:38 -05:00
nfs4getroot.c
nfs4idmap.c cred: Do not default to init_cred in prepare_kernel_cred() 2022-11-01 10:04:52 -07:00
nfs4idmap.h
nfs4namespace.c NFS: Avoid memcpy() run-time warning for struct sockaddr overflows 2022-10-27 15:52:10 -04:00
nfs4proc.c NFS: fix disabling of swap 2023-02-15 10:33:00 -05:00
nfs4renewd.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
nfs4session.c NFSv4: Sanity check the parameters in nfs41_update_target_slotid() 2021-11-07 09:23:14 -05:00
nfs4session.h NFSv4: Sanity check the parameters in nfs41_update_target_slotid() 2021-11-07 09:23:14 -05:00
nfs4state.c NFS client updates for Linux 6.2 2022-12-13 08:44:41 -08:00
nfs4super.c NFS: Adjust fs_context error logging 2021-01-10 13:32:39 -05:00
nfs4sysctl.c
nfs4trace.c pNFS/flexfiles: Add tracing for layout errors 2020-01-15 10:54:33 -05:00
nfs4trace.h nfs4trace: fix state manager flag printing 2023-02-14 15:43:57 -05:00
nfs4xdr.c NFSv4.2: Fix a memory stomp in decode_attr_security_label 2022-11-27 22:09:59 -05:00
nfs42.h NFSv4.2: add the extended attribute proc functions. 2020-07-13 17:52:45 -04:00
nfs42proc.c NFSv4.2: Fixup CLONE dest file size for zero-length count 2022-10-27 15:52:10 -04:00
nfs42xattr.c nfs: remove unnecessary (void*) conversions. 2022-10-03 11:26:36 -04:00
nfs42xdr.c NFSv4.2: Fix up READ_PLUS alignment 2022-12-06 12:29:35 -05:00
nfs.h
nfsroot.c NFS: move from strlcpy with unused retval to strscpy 2022-10-03 11:26:36 -04:00
nfstrace.c NFSv4: Catch and trace server filehandle encoding errors 2021-04-14 09:36:29 -04:00
nfstrace.h NFS: Improve tracing of nfs_wb_folio() 2023-02-14 14:22:33 -05:00
pagelist.c NFS: Clean up O_DIRECT request allocation 2023-02-14 14:22:33 -05:00
pnfs_dev.c NFSv4/pnfs: Add tracing for the deviceid cache 2020-12-16 17:25:24 -05:00
pnfs_nfs.c NFS: Convert buffered writes to use folios 2023-02-14 14:22:32 -05:00
pnfs.c NFS Client Updates for Linux 6.1 2022-10-13 09:58:42 -07:00
pnfs.h NFS: Convert buffered writes to use folios 2023-02-14 14:22:32 -05:00
proc.c NFS: NFSv2/v3 clients should never be setting NFS_CAP_XATTR 2022-02-25 18:50:13 -05:00
read.c NFS: Remove unnecessary check in nfs_read_folio() 2023-02-14 14:22:33 -05:00
super.c NFS: Avoid memcpy() run-time warning for struct sockaddr overflows 2022-10-27 15:52:10 -04:00
symlink.c fs: Change the type of filler_t 2022-05-09 16:36:48 -04:00
sysctl.c
sysfs.c Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
sysfs.h NFSv4: Fix up RCU annotations for struct nfs_netns_client 2020-10-15 13:31:08 -04:00
unlink.c NFS: Fix a race in nfs_call_unlink() 2022-11-27 22:10:00 -05:00
write.c NFS: Improve tracing of nfs_wb_folio() 2023-02-14 14:22:33 -05:00