f2fs: fix wrong description in printed log
Chao Yu
maintainerPATCH 1/6 f2fs: fix wrong description in printed log
This patch fixes wrong description in printed log:
"SSA and SIT" -> "SIT and SSA"
--- fs/f2fs/gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/gc.c +1 -1
@@ -1897,7 +1897,7 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi, sum =SUM_BLK_PAGE_ADDR (sbi, sum_folio, cur_segno);if (type !=GET_SUM_TYPE (sum_footer (sbi, sum))) {f2fs_err (sbi,"Inconsistent segment (%u) type " -"[%d, %d] in SSA and SIT" , +"[%d, %d] in SIT and SSA" , cur_segno, type,GET_SUM_TYPE (sum_footer (sbi, sum)));
Signature · 1 line
2.49.0
Chao Yu
maintainerPATCH 2/6 f2fs: misc cleanup in f2fs_record_stop_reason()
--- fs/f2fs/super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/f2fs/super.c +1 -2
@@ -4648,8 +4648,7 @@ static void f2fs_record_stop_reason(struct f2fs_sb_info *sbi)spin_lock_irqsave (&sbi->error_lock, flags);if (sbi->error_dirty) { -memcpy (F2FS_RAW_SUPER (sbi)->s_errors, sbi->errors, -MAX_F2FS_ERRORS ); +memcpy (raw_super->s_errors, sbi->errors,MAX_F2FS_ERRORS ); sbi->error_dirty = false; }memcpy (raw_super->s_stop_reason, sbi->stop_reason,MAX_STOP_REASON );
Signature · 1 line
2.49.0
Chao Yu
maintainerPATCH 3/6 f2fs: avoid unnecessary sanity check on ckpt_valid_blocks
In reply to Chao YuThe calculation of sec->ckpt_valid_blocks are the same in both set_ckpt_valid_blocks() and sanity_check_valid_blocks(), so it doesn't necessary to call sanity_check_valid_blocks() right after set_ckpt_valid_blocks().
--- fs/f2fs/segment.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
fs/f2fs/segment.c +2 -6
@@ -4802,10 +4802,8 @@ void f2fs_flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc) }/* update ckpt_valid_block */ -if (__is_large_section (sbi)) { +if (__is_large_section (sbi))set_ckpt_valid_blocks (sbi, segno); -sanity_check_valid_blocks (sbi, segno); - }__clear_bit (segno, bitmap); sit_i->dirty_sentries--;
@@ -5133,10 +5131,8 @@ static int build_sit_entries(struct f2fs_sb_info *sbi)if (__is_large_section (sbi)) {unsigned int segno; -for (segno =0 ; segno <MAIN_SEGS (sbi); segno +=SEGS_PER_SEC (sbi)) { +for (segno =0 ; segno <MAIN_SEGS (sbi); segno +=SEGS_PER_SEC (sbi))set_ckpt_valid_blocks (sbi, segno); -sanity_check_valid_blocks (sbi, segno); - } }if (err)
Signature · 1 line
2.49.0
Chao Yu
maintainerPATCH 4/6 f2fs: avoid unnecessary fscrypt_finalize_bounce_page()
In reply to Chao Yufscrypt_finalize_bounce_page() should be called only if we use fs layer crypto, let's avoid unnecessary fscrypt_finalize_bounce_page() in error path of f2fs_write_compressed_pages().
BTW, fscrypt_finalize_bounce_page() will check mapping of bounced page before retrieving original page, so, previously it won't cause any issue w/ fscrypt_finalize_bounce_page(), but still we'd better avoid coupling w/ any logic inside fscrypt_finalize_bounce_page().
--- fs/f2fs/compress.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
fs/f2fs/compress.c +6 -4
@@ -1455,10 +1455,12 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, out_destroy_crypt:page_array_free (sbi, cic->rpages, cc->cluster_size); -for (--i; i >=0 ; i--) { -if (!cc->cpages[i]) -continue ; -fscrypt_finalize_bounce_page (&cc->cpages[i]); +if (fio.encrypted) { +for (--i; i >=0 ; i--) { +if (!cc->cpages[i]) +continue ; +fscrypt_finalize_bounce_page (&cc->cpages[i]); + } } out_put_cic:kmem_cache_free (cic_entry_slab, cic);
Signature · 1 line
2.49.0
Jaegeuk Kim
maintainerRe: [f2fs-dev] [PATCH 4/6] f2fs: avoid unnecessary fscrypt_finalize_bounce_page()
Quoted 22 lines · On 06/15, Chao Yu via Linux-f2fs-devel wrote:
fscrypt_finalize_bounce_page()should be called only if we use fs layer crypto, let's avoid unnecessaryfscrypt_finalize_bounce_page()in error path off2fs_write_compressed_pages().BTW,
fscrypt_finalize_bounce_page()will check mapping of bounced page before retrieving original page, so, previously it won't cause any issue w/fscrypt_finalize_bounce_page(), but still we'd better avoid coupling w/ any logic insidefscrypt_finalize_bounce_page().Signed-off-by Chao Yu <[email protected]>--- fs/f2fs/compress.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)fs/f2fs/compress.c +0
-0@@ -1455,10 +1455,12 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, out_destroy_crypt:page_array_free (sbi, cic->rpages, cc->cluster_size);
fs/f2fs/compress.c static int f2fs_write_compressed_pages(struct compress_ctx *cc, · line 1463
Quoted 10 lines
fs/f2fs/compress.c +6
-4-for (--i; i >=0 ; i--) { -if (!cc->cpages[i]) -continue ; -fscrypt_finalize_bounce_page (&cc->cpages[i]); +if (fio.encrypted) { +for (--i; i >=0 ; i--) { +if (!cc->cpages[i]) +continue ; +fscrypt_finalize_bounce_page (&cc->cpages[i]); + }
Applied as:
fs/f2fs/compress.c +3 -0
@@ -1455,6 +1455,9 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, out_destroy_crypt:page_array_free (sbi, cic->rpages, cc->cluster_size); +if (!fio.encrypted) + goto out_put_cic; +for (--i; i >=0 ; i--) {if (!cc->cpages[i])continue ;
Quoted 12 lines
fs/f2fs/compress.c +0
-0} out_put_cic:kmem_cache_free (cic_entry_slab, cic);Signature · 8 lines
2.49.0 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Chao Yu
maintainerRe: [f2fs-dev] [PATCH 4/6] f2fs: avoid unnecessary fscrypt_finalize_bounce_page()
Quoted 39 lines · Jaegeuk Kim
Quoted 22 lines · On 06/15, Chao Yu via Linux-f2fs-devel wrote:
fscrypt_finalize_bounce_page()should be called only if we use fs layer crypto, let's avoid unnecessaryfscrypt_finalize_bounce_page()in error path off2fs_write_compressed_pages().BTW,
fscrypt_finalize_bounce_page()will check mapping of bounced page before retrieving original page, so, previously it won't cause any issue w/fscrypt_finalize_bounce_page(), but still we'd better avoid coupling w/ any logic insidefscrypt_finalize_bounce_page().Signed-off-by Chao Yu <[email protected]>--- fs/f2fs/compress.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)fs/f2fs/compress.c +0
-0@@ -1455,10 +1455,12 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, out_destroy_crypt:page_array_free (sbi, cic->rpages, cc->cluster_size);fs/f2fs/compress.c static int f2fs_write_compressed_pages(struct compress_ctx *cc, · line 1463
Quoted 10 lines
fs/f2fs/compress.c +6
-4-for (--i; i >=0 ; i--) { -if (!cc->cpages[i]) -continue ; -fscrypt_finalize_bounce_page (&cc->cpages[i]); +if (fio.encrypted) { +for (--i; i >=0 ; i--) { +if (!cc->cpages[i]) +continue ; +fscrypt_finalize_bounce_page (&cc->cpages[i]); + }Applied as:
fs/f2fs/compress.c static int f2fs_write_compressed_pages(struct compress_ctx *cc, · line 1459
Quoted 5 lines
fs/f2fs/compress.c +2
-0@@ -1455,6 +1455,9 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, out_destroy_crypt:page_array_free (sbi, cic->rpages, cc->cluster_size); +if (!fio.encrypted) + goto out_put_cic;
Looks fine to me.
Thanks,
Quoted 18 lines
fs/f2fs/compress.c +1
-0+for (--i; i >=0 ; i--) {if (!cc->cpages[i])continue ;Quoted 14 lines
fs/f2fs/compress.c +0
-0} out_put_cic:kmem_cache_free (cic_entry_slab, cic);Signature · 8 lines
2.49.0 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Chao Yu
maintainerPATCH 5/6 f2fs: use fscrypt_finalize_bounce_page() for cleanup
In reply to Chao YuNo logic changes.
--- fs/f2fs/data.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
fs/f2fs/data.c +3 -6
@@ -358,14 +358,11 @@ static void f2fs_write_end_io(struct bio *bio)bio_for_each_folio_all (fi, bio) {struct folio *folio = fi.folio; +struct page *page = &folio->page;enum count_type type; -if (fscrypt_is_bounce_folio (folio)) { -struct folio *io_folio = folio; - - folio =fscrypt_pagecache_folio (io_folio); -fscrypt_free_bounce_page (&io_folio->page); - } +fscrypt_finalize_bounce_page (&page); + folio =page_folio (page);#ifdef CONFIG_F2FS_FS_COMPRESSION if (f2fs_is_compressed_page (folio)) {
Signature · 1 line
2.49.0
Re: [PATCH 5/6] f2fs: use fscrypt_finalize_bounce_page() for cleanup
Quoted 1 line · Chao Yu
No logic changes.
This seems like a step backwards. We should be looking to convert to a future fscrypt_finalize_bounce_folio(), if anything.
Chao Yu
maintainerRe: [PATCH 5/6] f2fs: use fscrypt_finalize_bounce_page() for cleanup
Quoted 5 lines · Matthew Wilcox
Quoted 1 line · Chao Yu
No logic changes.
This seems like a step backwards. We should be looking to convert to a future
fscrypt_finalize_bounce_folio(), if anything.
You're right, what do you think of this?
From 533ee72170c2ad451097db926dd713d9fea442f9 Mon Sep 17 00:00:00 2001
From: Chao Yu <[email protected]>
Date: Fri, 26 Sep 2025 01:43:06 +0800
Subject: [PATCH] fscrypt,f2fs: introduce fscrypt_finalize_bounce_folio() for
cleanup
As part of the linux kernel's migration to folio-based APIs, introduce fscrypt_finalize_bounce_folio() as the folio equivalent of fscrypt_finalize_bounce_page(), and clean up f2fs codes with this new helper.
--- fs/f2fs/data.c | 7 +------ include/linux/fscrypt.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-)
fs/f2fs/data.c +1 -6
@@ -362,12 +362,7 @@ static void f2fs_write_end_bio(struct bio *bio)struct folio *folio = fi.folio;enum count_type type; -if (fscrypt_is_bounce_folio (folio)) { -struct folio *io_folio = folio; - - folio =fscrypt_pagecache_folio (io_folio); -fscrypt_free_bounce_page (&io_folio->page); - } +fscrypt_finalize_bounce_folio (&folio);#ifdef CONFIG_F2FS_FS_COMPRESSION if (f2fs_is_compressed_page (folio)) {
include/linux/fscrypt.h +11 -0
@@ -1132,4 +1132,15 @@ static inline void fscrypt_finalize_bounce_page(struct page **pagep) } } +/* If *foliop is a bounce folio, free it and set *foliop to the pagecache folio */ +static inline void fscrypt_finalize_bounce_folio (struct folio **foliop) +{ +struct folio *folio = *foliop; + +if (fscrypt_is_bounce_folio (folio)) { + *foliop =fscrypt_pagecache_folio (folio); +fscrypt_free_bounce_page (&folio->page); + } +} +#endif /* _LINUX_FSCRYPT_H */
Signature · 1 line
2.49.0
Chao Yu
maintainerPATCH 6/6 f2fs: remove unneeded f2fs_is_compressed_page()
In reply to Chao YuWe have checked f2fs_is_compressed_page() before f2fs_compress_write_end_io(), so we don't need to check the status again, remove it.
--- fs/f2fs/compress.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/f2fs/compress.c +1 -2
@@ -1486,8 +1486,7 @@ void f2fs_compress_write_end_io(struct bio *bio, struct folio *folio)struct page *page = &folio->page;struct f2fs_sb_info *sbi = bio->bi_private;struct compress_io_ctx *cic = folio->private; -enum count_type type =WB_DATA_TYPE (folio, -f2fs_is_compressed_page (folio)); +enum count_type type =WB_DATA_TYPE (folio, true);int i;if (unlikely (bio->bi_status !=BLK_STS_OK ))
Signature · 1 line
2.49.0
This series was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:
Hello:
This series was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:
Quoted 8 lines · On Mon, 15 Jun 2026 21:08:17 +0800 you wrote:
This patch fixes wrong description in printed log:
"SSA and SIT" -> "SIT and SSA"
Signed-off-by Chao Yu <[email protected]>--- fs/f2fs/gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [f2fs-dev,1/6] f2fs: fix wrong description in printed log
https://git.kernel.org/jaegeuk/f2fs/c/123a88353dac - [f2fs-dev,2/6] f2fs: misc cleanup in f2fs_record_stop_reason() https://git.kernel.org/jaegeuk/f2fs/c/a1c83470ed0b - [f2fs-dev,3/6] f2fs: avoid unnecessary sanity check on ckpt_valid_blocks https://git.kernel.org/jaegeuk/f2fs/c/701959ef9b9f - [f2fs-dev,4/6] f2fs: avoid unnecessary fscrypt_finalize_bounce_page() (no matching commit) - [f2fs-dev,5/6] f2fs: use fscrypt_finalize_bounce_page() for cleanup (no matching commit) - [f2fs-dev,6/6] f2fs: remove unneeded f2fs_is_compressed_page() https://git.kernel.org/jaegeuk/f2fs/c/7cc48ead1a8a
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html