Skip to content

Commit a2b6f2a

Browse files
VMooladhowells
authored andcommitted
afs: Fix dangling folio ref counts in writeback
Commit acc8d85 converted afs_writepages_region() to write back a folio batch. If writeback needs rescheduling, the function exits without dropping the references to the folios in fbatch. This patch fixes that. [DH: Moved the added line before the _leave()] 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 45a3e24 commit a2b6f2a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/afs/write.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ static int afs_writepages_region(struct address_space *mapping,
763763
if (wbc->sync_mode == WB_SYNC_NONE) {
764764
if (skips >= 5 || need_resched()) {
765765
*_next = start;
766+
folio_batch_release(&fbatch);
766767
_leave(" = 0 [%llx]", *_next);
767768
return 0;
768769
}

0 commit comments

Comments
 (0)