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) <vishal.moola@gmail.com> Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/20230607204120.89416-1-vishal.moola@gmail.com/
1 parent 45a3e24 commit a2b6f2a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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)