diff mbox series

[v3,2/2] btrfs: fix __folio_put refcount in __alloc_dummy_extent_buffer

Message ID a6388a5263792fd161ec19cfc68c4c5235c6b828.1719930430.git.boris@bur.io (mailing list archive)
State New
Headers show
Series btrfs: fix __folio_put refcount errors | expand

Commit Message

Boris Burkov July 2, 2024, 2:31 p.m. UTC
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: 13df3775efca ("btrfs: cleanup metadata page pointer usage")
Signed-off-by: Boris Burkov <boris@bur.io>
---
 fs/btrfs/extent_io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index d3ce07ab9692..cb315779af30 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2775,7 +2775,7 @@  struct extent_buffer *__alloc_dummy_extent_buffer(struct btrfs_fs_info *fs_info,
 	for (int i = 0; i < num_folios; i++) {
 		if (eb->folios[i]) {
 			detach_extent_buffer_folio(eb, eb->folios[i]);
-			__folio_put(eb->folios[i]);
+			folio_put(eb->folios[i]);
 		}
 	}
 	__free_extent_buffer(eb);