Skip to content

Commit 819da02

Browse files
VMooladhowells
authored andcommitted
afs: Fix waiting for writeback then skipping folio
Commit acc8d85 converted afs_writepages_region() to write back a folio batch. The function waits for writeback to a folio, but then proceeds to the rest of the batch without trying to write that folio again. This patch fixes has it attempt to write the folio again. [DH: Also remove an 'else' that adding a goto makes redundant] Fixes: acc8d85 ("afs: convert afs_writepages_region() to use filemap_get_folios_tag()") Signed-off-by: Vishal Moola (Oracle) <[email protected]> Signed-off-by: David Howells <[email protected]> cc: Marc Dionne <[email protected]> cc: [email protected] Link: https://lore.kernel.org/r/[email protected]/
1 parent a2b6f2a commit 819da02

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/afs/write.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ static int afs_writepages_region(struct address_space *mapping,
731731
* (changing page->mapping to NULL), or even swizzled
732732
* back from swapper_space to tmpfs file mapping
733733
*/
734+
try_again:
734735
if (wbc->sync_mode != WB_SYNC_NONE) {
735736
ret = folio_lock_killable(folio);
736737
if (ret < 0) {
@@ -757,9 +758,10 @@ static int afs_writepages_region(struct address_space *mapping,
757758
#ifdef CONFIG_AFS_FSCACHE
758759
folio_wait_fscache(folio);
759760
#endif
760-
} else {
761-
start += folio_size(folio);
761+
goto try_again;
762762
}
763+
764+
start += folio_size(folio);
763765
if (wbc->sync_mode == WB_SYNC_NONE) {
764766
if (skips >= 5 || need_resched()) {
765767
*_next = start;

0 commit comments

Comments
 (0)