Skip to contentSkip to conversation

f2fs: fix to call clear_page_private_reference in .{release,invalid}_folio

PATCH Applied Chao Yu 2 participants 2 messages Dec 21, 2022 – Jan 9, 2023 F2FS file system

lore
Share & tools
lore

Chao Yu

author maintainer
#0 lore raw

PATCH 1/1 f2fs: fix to call clear_page_private_reference in .{release,invalid}_folio

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.

---
 fs/f2fs/data.c | 2 ++
 fs/f2fs/f2fs.h | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/data.c +2 -0
index b1ec0fbf1c8f..53d8945df2c1 100644
@@ -3696,6 +3696,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) &&
@@ -3721,6 +3722,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);
fs/f2fs/f2fs.h +0 -1
index 9da26d4ec017..049d4fa0b59e 100644
@@ -1453,7 +1453,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(dummy, DUMMY_WRITE);
Signature · 8 lines
2.36.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
#1 lore raw

Re: [f2fs-dev] [PATCH] f2fs: fix to call clear_page_private_reference in .{release, invalid}_folio

This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 8 lines · On Wed, 21 Dec 2022 20:13:45 +0800 you wrote:

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.

[...]

Here is the summary with links:
- [f2fs-dev] f2fs: fix to call clear_page_private_reference in .{release, invalid}_folio

    https://git.kernel.org/jaegeuk/f2fs/c/6779b5db90c5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html