diff options
author | David Howells <dhowells@redhat.com> | 2022-03-11 15:58:21 +0000 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-03-11 10:24:37 -0800 |
commit | 173ce1ca47c489135b2799f70f550e1319ba36d8 (patch) | |
tree | 5dc9f1cd8aeb26aed6e552d93831c881312df016 /.get_maintainer.ignore | |
parent | 4edc0760412b0c4ecefc7e02cb855b310b122825 (diff) | |
download | linux-173ce1ca47c489135b2799f70f550e1319ba36d8.tar.bz2 |
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: 31143d5d515e ("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>
Diffstat (limited to '.get_maintainer.ignore')
0 files changed, 0 insertions, 0 deletions