Skip to content

Commit de95dd6

Browse files
boryasgregkh
authored andcommitted
btrfs: fix folio refcount in __alloc_dummy_extent_buffer()
commit a56c85f upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 326fa14 commit de95dd6

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
@@ -3526,7 +3526,7 @@ struct extent_buffer *__alloc_dummy_extent_buffer(struct btrfs_fs_info *fs_info,
35263526
for (int i = 0; i < num_folios; i++) {
35273527
if (eb->folios[i]) {
35283528
detach_extent_buffer_folio(eb, eb->folios[i]);
3529-
__folio_put(eb->folios[i]);
3529+
folio_put(eb->folios[i]);
35303530
}
35313531
}
35323532
__free_extent_buffer(eb);

0 commit comments

Comments
 (0)