]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
f2fs: fix to call clear_page_private_reference in .{release,invalid}_folio
authorChao Yu <chao@kernel.org>
Sat, 23 Aug 2025 02:50:08 +0000 (22:50 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:26:15 +0000 (16:26 +0200)
[ Upstream commit 6779b5db90c5b925293f7ccc5ed5336c5b24ed50 ]

b763f3bedc2d ("f2fs: restructure f2fs page.private layout") missed
to call clear_page_private_reference() in .{release,invalid}_folio,
fix it, though it's not a big deal since folio_detach_private() was
called to clear all privae info and reference count in the page.

BTW, remove page_private_reference() definition as it never be used.

Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Stable-dep-of: 77de19b6867f ("f2fs: fix to avoid out-of-boundary access in dnode page")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/data.c
fs/f2fs/f2fs.h

index dc8f283f210cc659f1550de55d688f71dbdfaddd..2b018d365b914e26e2aa4663ad90d62a5884a318 100644 (file)
@@ -3729,6 +3729,7 @@ void f2fs_invalidate_folio(struct folio *folio, size_t offset, size_t length)
                }
        }
 
+       clear_page_private_reference(&folio->page);
        clear_page_private_gcing(&folio->page);
 
        if (test_opt(sbi, COMPRESS_CACHE) &&
@@ -3754,6 +3755,7 @@ bool f2fs_release_folio(struct folio *folio, gfp_t wait)
                        clear_page_private_data(&folio->page);
        }
 
+       clear_page_private_reference(&folio->page);
        clear_page_private_gcing(&folio->page);
 
        folio_detach_private(folio);
index 1ad9669666e8b3f3a862378056dbbfe2ce028d5d..ad7bc58ce0a407e676234c6cd3e6b1545eb6234b 100644 (file)
@@ -1428,7 +1428,6 @@ static inline void clear_page_private_##name(struct page *page) \
 }
 
 PAGE_PRIVATE_GET_FUNC(nonpointer, NOT_POINTER);
-PAGE_PRIVATE_GET_FUNC(reference, REF_RESOURCE);
 PAGE_PRIVATE_GET_FUNC(inline, INLINE_INODE);
 PAGE_PRIVATE_GET_FUNC(gcing, ONGOING_MIGRATION);
 PAGE_PRIVATE_GET_FUNC(atomic, ATOMIC_WRITE);