linux-stable/fs/nfs
NeilBrown 7e907c022e NFS: swap-out must always use STABLE writes.
[ Upstream commit c265de257f ]

The commit handling code is not safe against memory-pressure deadlocks
when writing to swap.  In particular, nfs_commitdata_alloc() blocks
indefinitely waiting for memory, and this can consume all available
workqueue threads.

swap-out most likely uses STABLE writes anyway as COND_STABLE indicates
that a stable write should be used if the write fits in a single
request, and it normally does.  However if we ever swap with a small
wsize, or gather unusually large numbers of pages for a single write,
this might change.

For safety, make it explicit in the code that direct writes used for swap
must always use FLUSH_STABLE.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-20 09:08:28 +02:00
..
blocklayout pnfs/blocklayout: off by one in bl_map_stripe() 2018-09-09 19:55:59 +02:00
filelayout NFS: fix an incorrect limit in filelayout_decode_layout() 2021-06-03 08:36:18 +02:00
flexfilelayout pnfs/flexfiles: Fix misplaced barrier in nfs4_ff_layout_prepare_ds 2021-11-26 11:40:34 +01:00
cache_lib.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cache_lib.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
callback.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
callback.h NFSv4.1: Fix uninitialised variable in devicenotify 2022-02-16 12:44:49 +01:00
callback_proc.c NFSv4/pNFS: Fix another issue with a list iterator pointing to the head 2022-04-20 09:08:21 +02:00
callback_xdr.c NFS: remove unneeded check in decode_devicenotify_args() 2022-04-20 09:08:20 +02:00
client.c NFS: Fix initialisation of nfs_client cl_flags field 2022-02-16 12:44:49 +01:00
delegation.c NFS: Fix a soft lockup in the delegation recovery code 2020-01-27 14:46:21 +01:00
delegation.h NFS: Fix a soft lockup in the delegation recovery code 2020-01-27 14:46:21 +01:00
dir.c NFS: LOOKUP_DIRECTORY is also ok with symlinks 2022-02-23 11:57:35 +01:00
direct.c NFS: swap-out must always use STABLE writes. 2022-04-20 09:08:28 +02:00
dns_resolve.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dns_resolve.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
export.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
file.c NFS: swap IO handling is slightly different for O_DIRECT IO 2022-04-20 09:08:28 +02:00
fscache-index.c
fscache.c
fscache.h
getroot.c
inode.c NFS: Do not report writeback errors in nfs_getattr() 2022-02-23 11:57:36 +01:00
internal.h NFS: nfs_igrab_and_active must first reference the superblock 2021-01-23 15:48:44 +01:00
io.c NFS: Fix a race between mmap() and O_DIRECT 2018-02-16 20:22:59 +01:00
iostat.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig nfs: fix PNFS_FLEXFILE_LAYOUT Kconfig default 2021-03-30 14:40:08 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mount_clnt.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
namespace.c NFS: fix nfs_path in case of a rename retry 2020-11-05 11:06:59 +01:00
netns.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfs2super.c
nfs2xdr.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfs3_fs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfs3acl.c nfs: Fix potential posix_acl refcnt leak in nfs3_set_acl 2020-05-05 19:15:52 +02:00
nfs3client.c
nfs3proc.c nfs: fix acl memory leak of posix_acl_create() 2021-07-20 16:17:53 +02:00
nfs3super.c
nfs3xdr.c NFS: Correct size calculation for create reply length 2021-03-30 14:40:08 +02:00
nfs4_fs.h NFSv4 expose nfs_parse_server_name function 2022-02-16 12:44:49 +01:00
nfs4client.c nfs: nfs4clinet: check the return value of kstrdup() 2022-02-16 12:44:49 +01:00
nfs4file.c NFSv4: Fix v4.0/v4.1 SEEK_DATA return -ENOTSUPP when set NFS_V4_2 config 2021-06-03 08:36:18 +02:00
nfs4getroot.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfs4idmap.c keys: Fix dependency loop between construction record and auth key 2019-03-23 14:35:14 +01:00
nfs4idmap.h
nfs4namespace.c NFSv4 expose nfs_parse_server_name function 2022-02-16 12:44:49 +01:00
nfs4proc.c NFSv4: nfs4_proc_set_acl needs to restore NFS_CAP_UIDGID_NOMAP on error. 2021-06-16 11:53:04 +02:00
nfs4renewd.c
nfs4session.c
nfs4session.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfs4state.c NFSv4 remove zero number of fs_locations entries error check 2022-02-16 12:44:49 +01:00
nfs4super.c
nfs4sysctl.c nfs: Do not convert nfs_idmap_cache_timeout to jiffies 2018-04-26 11:02:08 +02:00
nfs4trace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfs4trace.h NFS: Avoid RCU usage in tracepoints 2017-11-30 08:40:46 +00:00
nfs4xdr.c NFSv4 remove zero number of fs_locations entries error check 2022-02-16 12:44:49 +01:00
nfs42.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfs42proc.c NFSv42: Fix pagecache invalidation after COPY/CLONE 2021-12-08 08:46:53 +01:00
nfs42xdr.c NFSv42: Don't fail clone() unless the OP_CLONE operation failed 2021-12-08 08:46:48 +01:00
nfsroot.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfstrace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfstrace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pagelist.c NFS: Don't corrupt the value of pg_bytes_written in nfs_do_recoalesce() 2021-06-03 08:36:18 +02:00
pnfs.c NFSv4/pNFS: Fix another issue with a list iterator pointing to the head 2022-04-20 09:08:21 +02:00
pnfs.h NFSv4/pNFS: Fix another issue with a list iterator pointing to the head 2022-04-20 09:08:21 +02:00
pnfs_dev.c
pnfs_nfs.c pnfs/flexfiles: Fix misplaced barrier in nfs4_ff_layout_prepare_ds 2021-11-26 11:40:34 +01:00
proc.c NFSv2: Fix write regression 2019-09-21 07:15:37 +02:00
read.c NFS: Pass error information to the pgio error cleanup routine 2019-09-06 10:21:00 +02:00
super.c fs/nfs: Fix nfs_parse_devname to not modify it's argument 2020-01-27 14:46:21 +01:00
symlink.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sysctl.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
unlink.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
write.c NFS: Fix deadlocks in nfs_scan_commit_list() 2021-11-26 11:40:34 +01:00