aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-06-19 11:22:46 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-06-19 11:22:46 -0700
commitdbad9ce9397ef7f891b4ff44bad694add673c1a1 (patch)
tree7482d29ddb7a3c9c7dbf9302e3128caf7eb3879c
parent45a3e24f65e90a047bef86f927ebdc4c710edaa1 (diff)
parent819da022dd007398d0c42ebcd8dbb1b681acea53 (diff)
downloadps3-linux-dbad9ce9397ef7f891b4ff44bad694add673c1a1.tar.gz
Merge tag 'afs-fixes-20230719' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
Pull AFS writeback fixes from David Howells: - release the acquired batch before returning if we got >=5 skips - retry a page we had to wait for rather than skipping over it after the wait * tag 'afs-fixes-20230719' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: afs: Fix waiting for writeback then skipping folio afs: Fix dangling folio ref counts in writeback
-rw-r--r--fs/afs/write.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/afs/write.c b/fs/afs/write.c
index c822d6006033a..8750b99c3f566 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -731,6 +731,7 @@ static int afs_writepages_region(struct address_space *mapping,
* (changing page->mapping to NULL), or even swizzled
* back from swapper_space to tmpfs file mapping
*/
+try_again:
if (wbc->sync_mode != WB_SYNC_NONE) {
ret = folio_lock_killable(folio);
if (ret < 0) {
@@ -757,12 +758,14 @@ static int afs_writepages_region(struct address_space *mapping,
#ifdef CONFIG_AFS_FSCACHE
folio_wait_fscache(folio);
#endif
- } else {
- start += folio_size(folio);
+ goto try_again;
}
+
+ start += folio_size(folio);
if (wbc->sync_mode == WB_SYNC_NONE) {
if (skips >= 5 || need_resched()) {
*_next = start;
+ folio_batch_release(&fbatch);
_leave(" = 0 [%llx]", *_next);
return 0;
}