* [PATCH] f2fs: fix incomplete block usage in compact SSA summaries
@ 2026-01-26 22:28 Daeho Jeong
2026-01-30 3:12 ` [f2fs-dev] " Chao Yu
2026-01-30 17:10 ` patchwork-bot+f2fs
0 siblings, 2 replies; 3+ messages in thread
From: Daeho Jeong @ 2026-01-26 22:28 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong, Chris Mason
From: Daeho Jeong <daehojeong@google.com>
In a previous commit, a bug was introduced where compact SSA summaries
failed to utilize the entire block space in non-4KB block size
configurations, leading to inefficient space management.
This patch fixes the calculation logic to ensure that compact SSA
summaries can fully occupy the block regardless of the block size.
Reported-by: Chris Mason <clm@meta.com>
Fixes: e48e16f3e37f ("f2fs: support non-4KB block size without packed_ssa feature")
Signed-off-by: Daeho Jeong <daehojeong@google.com>
---
fs/f2fs/segment.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 00870a8fe387..6a97fe76712b 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -2674,12 +2674,12 @@ int f2fs_npages_for_summary_flush(struct f2fs_sb_info *sbi, bool for_ra)
valid_sum_count += f2fs_curseg_valid_blocks(sbi, i);
}
- sum_in_page = (sbi->sum_blocksize - 2 * sbi->sum_journal_size -
+ sum_in_page = (sbi->blocksize - 2 * sbi->sum_journal_size -
SUM_FOOTER_SIZE) / SUMMARY_SIZE;
if (valid_sum_count <= sum_in_page)
return 1;
else if ((valid_sum_count - sum_in_page) <=
- (sbi->sum_blocksize - SUM_FOOTER_SIZE) / SUMMARY_SIZE)
+ (sbi->blocksize - SUM_FOOTER_SIZE) / SUMMARY_SIZE)
return 2;
return 3;
}
@@ -4324,7 +4324,7 @@ static int read_compacted_summaries(struct f2fs_sb_info *sbi)
s = (struct f2fs_summary *)(kaddr + offset);
sum_entries(seg_i->sum_blk)[j] = *s;
offset += SUMMARY_SIZE;
- if (offset + SUMMARY_SIZE <= sbi->sum_blocksize -
+ if (offset + SUMMARY_SIZE <= sbi->blocksize -
SUM_FOOTER_SIZE)
continue;
@@ -4497,7 +4497,7 @@ static void write_compacted_summaries(struct f2fs_sb_info *sbi, block_t blkaddr)
*summary = sum_entries(seg_i->sum_blk)[j];
written_size += SUMMARY_SIZE;
- if (written_size + SUMMARY_SIZE <= PAGE_SIZE -
+ if (written_size + SUMMARY_SIZE <= sbi->blocksize -
SUM_FOOTER_SIZE)
continue;
--
2.52.0.457.g6b5491de43-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: fix incomplete block usage in compact SSA summaries
2026-01-26 22:28 [PATCH] f2fs: fix incomplete block usage in compact SSA summaries Daeho Jeong
@ 2026-01-30 3:12 ` Chao Yu
2026-01-30 17:10 ` patchwork-bot+f2fs
1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2026-01-30 3:12 UTC (permalink / raw)
To: Daeho Jeong, linux-kernel, linux-f2fs-devel, kernel-team
Cc: chao, Chris Mason, Daeho Jeong
On 1/27/2026 6:28 AM, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
>
> In a previous commit, a bug was introduced where compact SSA summaries
> failed to utilize the entire block space in non-4KB block size
> configurations, leading to inefficient space management.
>
> This patch fixes the calculation logic to ensure that compact SSA
> summaries can fully occupy the block regardless of the block size.
>
> Reported-by: Chris Mason <clm@meta.com>
> Fixes: e48e16f3e37f ("f2fs: support non-4KB block size without packed_ssa feature")
> Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: fix incomplete block usage in compact SSA summaries
2026-01-26 22:28 [PATCH] f2fs: fix incomplete block usage in compact SSA summaries Daeho Jeong
2026-01-30 3:12 ` [f2fs-dev] " Chao Yu
@ 2026-01-30 17:10 ` patchwork-bot+f2fs
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+f2fs @ 2026-01-30 17:10 UTC (permalink / raw)
To: Daeho Jeong; +Cc: linux-kernel, linux-f2fs-devel, kernel-team, clm, daehojeong
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:
On Mon, 26 Jan 2026 14:28:01 -0800 you wrote:
> From: Daeho Jeong <daehojeong@google.com>
>
> In a previous commit, a bug was introduced where compact SSA summaries
> failed to utilize the entire block space in non-4KB block size
> configurations, leading to inefficient space management.
>
> This patch fixes the calculation logic to ensure that compact SSA
> summaries can fully occupy the block regardless of the block size.
>
> [...]
Here is the summary with links:
- [f2fs-dev] f2fs: fix incomplete block usage in compact SSA summaries
https://git.kernel.org/jaegeuk/f2fs/c/91b76f1059b6
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-30 17:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26 22:28 [PATCH] f2fs: fix incomplete block usage in compact SSA summaries Daeho Jeong
2026-01-30 3:12 ` [f2fs-dev] " Chao Yu
2026-01-30 17:10 ` patchwork-bot+f2fs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox