Skip to content

Commit a56c85f

Browse files
boryaskdave
authored andcommitted
btrfs: fix folio refcount in __alloc_dummy_extent_buffer()
Another improper use of __folio_put() in an error path after freshly allocating pages/folios which returns them with the refcount initialized to 1. The refactor from __free_pages() -> __folio_put() (instead of folio_put) removed a refcount decrement found in __free_pages() and folio_put but absent from __folio_put(). Fixes: 13df377 ("btrfs: cleanup metadata page pointer usage") CC: [email protected] # 6.8+ Tested-by: Ed Tomlinson <[email protected]> Reviewed-by: Filipe Manana <[email protected]> Signed-off-by: Boris Burkov <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent da0386c commit a56c85f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/extent_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3553,7 +3553,7 @@ struct extent_buffer *__alloc_dummy_extent_buffer(struct btrfs_fs_info *fs_info,
35533553
for (int i = 0; i < num_folios; i++) {
35543554
if (eb->folios[i]) {
35553555
detach_extent_buffer_folio(eb, eb->folios[i]);
3556-
__folio_put(eb->folios[i]);
3556+
folio_put(eb->folios[i]);
35573557
}
35583558
}
35593559
__free_extent_buffer(eb);

0 commit comments

Comments
 (0)