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: stable@vger.kernel.org # 6.8+ Tested-by: Ed Tomlinson <edtoml@gmail.com> Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Boris Burkov <boris@bur.io> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent da0386c commit a56c85f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)