linux/fs/afs
David Howells 173ce1ca47 afs: Fix potential thrashing in afs writeback
In afs_writepages_region(), if the dirty page we find is undergoing
writeback or write to cache, but the sync_mode is WB_SYNC_NONE, we go
round the loop trying the same page again and again with no pausing or
waiting unless and until another thread manages to clear the writeback
and fscache flags.

Fix this with three measures:

 (1) Advance start to after the page we found.

 (2) Break out of the loop and return if rescheduling is requested.

 (3) Arbitrarily give up after a maximum of 5 skips.

Fixes: 31143d5d51 ("AFS: implement basic file write support")
Reported-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Marc Dionne <marc.dionne@auristor.com>
Acked-by: Marc Dionne <marc.dionne@auristor.com>
Link: https://lore.kernel.org/r/164692725757.2097000.2060513769492301854.stgit@warthog.procyon.org.uk/ # v1
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-03-11 10:24:37 -08:00
..
addr_list.c afs: Use kfree_rcu() instead of casting kfree() to rcu_callback_t 2020-03-13 10:47:33 -07:00
afs_cm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
afs_fs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
afs_vl.h afs: Implement client support for the YFSVL.GetCellName RPC op 2020-06-04 15:37:57 +01:00
afs.h afs: Implement client support for the YFSVL.GetCellName RPC op 2020-06-04 15:37:57 +01:00
callback.c afs: Try to avoid taking RCU read lock when checking vnode validity 2021-09-13 09:10:39 +01:00
cell.c afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
cmservice.c afs: Fix tracepoint string placement with built-in AFS 2021-07-21 15:08:35 +01:00
dir_edit.c afs: Use folios in directory handling 2021-11-10 21:17:09 +00:00
dir_silly.c afs: Fix kerneldoc warning shown up by W=1 2021-10-04 22:04:44 +01:00
dir.c afs: Use folios in directory handling 2021-11-10 21:17:09 +00:00
dynroot.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
file.c fscache rewrite 2022-01-12 13:45:12 -08:00
flock.c fs: remove mandatory file locking support 2021-08-23 06:15:36 -04:00
fs_operation.c afs: Fix speculative status fetches 2021-05-01 11:55:36 -07:00
fs_probe.c afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server 2021-09-13 09:14:21 +01:00
fsclient.c afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server 2021-09-13 09:14:21 +01:00
inode.c afs: Skip truncation on the server of data we haven't written yet 2022-01-07 13:44:56 +00:00
internal.h afs: Copy local writes to the cache when writing to the server 2022-01-07 13:44:52 +00:00
Kconfig afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
main.c afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
Makefile afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
misc.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mntpt.c afs: Stop listxattr() from listing "afs.*" attributes 2021-03-15 17:09:54 +00:00
proc.c proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
protocol_afs.h afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server 2021-09-13 09:14:21 +01:00
protocol_uae.h afs: Add support for the UAE error table 2019-06-28 18:37:53 +01:00
protocol_yfs.h afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server 2021-09-13 09:14:21 +01:00
rotate.c afs: Try to avoid taking RCU read lock when checking vnode validity 2021-09-13 09:10:39 +01:00
rxrpc.c afs: Use ITER_XARRAY for writing 2021-04-23 10:17:27 +01:00
security.c fs: make helpers idmap mount aware 2021-01-24 14:27:20 +01:00
server_list.c afs: Reorganise volume and server trees to be rooted on the cell 2020-06-04 15:37:57 +01:00
server.c afs: Fix mmap coherency vs 3rd-party changes 2021-09-13 09:10:39 +01:00
super.c fscache rewrite 2022-01-12 13:45:12 -08:00
vl_alias.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
vl_list.c afs: Don't use VL probe running state to make decisions outside probe code 2020-08-20 18:21:28 +01:00
vl_probe.c afs: Don't use VL probe running state to make decisions outside probe code 2020-08-20 18:21:28 +01:00
vl_rotate.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
vlclient.c afs: Fix fall-through warnings for Clang 2021-05-25 07:30:34 -10:00
volume.c afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
write.c afs: Fix potential thrashing in afs writeback 2022-03-11 10:24:37 -08:00
xattr.c afs: Stop listxattr() from listing "afs.*" attributes 2021-03-15 17:09:54 +00:00
xdr_fs.h afs: Fix directory entry size calculation 2021-01-04 12:25:19 +00:00
yfsclient.c afs: Set mtime from the client for yfs create operations 2021-11-02 09:42:26 +00:00