]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.19-stable patches master
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Feb 2026 10:02:42 +0000 (11:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Feb 2026 10:02:42 +0000 (11:02 +0100)
added patches:
f2fs-fix-incomplete-block-usage-in-compact-ssa-summaries.patch

queue-6.19/f2fs-fix-incomplete-block-usage-in-compact-ssa-summaries.patch [new file with mode: 0644]
queue-6.19/series

diff --git a/queue-6.19/f2fs-fix-incomplete-block-usage-in-compact-ssa-summaries.patch b/queue-6.19/f2fs-fix-incomplete-block-usage-in-compact-ssa-summaries.patch
new file mode 100644 (file)
index 0000000..10eaa3a
--- /dev/null
@@ -0,0 +1,62 @@
+From 91b76f1059b60f453b51877f29f0e35693737383 Mon Sep 17 00:00:00 2001
+From: Daeho Jeong <daehojeong@google.com>
+Date: Mon, 26 Jan 2026 14:28:01 -0800
+Subject: f2fs: fix incomplete block usage in compact SSA summaries
+
+From: Daeho Jeong <daehojeong@google.com>
+
+commit 91b76f1059b60f453b51877f29f0e35693737383 upstream.
+
+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>
+Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
+Cc: Jiri Slaby <jirislaby@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/f2fs/segment.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/fs/f2fs/segment.c
++++ b/fs/f2fs/segment.c
+@@ -2685,12 +2685,12 @@ int f2fs_npages_for_summary_flush(struct
+                       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;
+ }
+@@ -4333,7 +4333,7 @@ static int read_compacted_summaries(stru
+                       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;
+@@ -4506,7 +4506,7 @@ static void write_compacted_summaries(st
+                       *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;
index fc03b9879cf2e81b90dfc21a8d3ac8fd776551a0..629b3a3b72f0a33d7c338b948d01290ffb1cc01f 100644 (file)
@@ -16,3 +16,4 @@ revert-f2fs-block-cache-dio-write-during-f2fs_enable_checkpoint.patch
 usb-serial-option-add-telit-fn920c04-rndis-compositions.patch
 f2fs-fix-to-do-sanity-check-on-node-footer-in-__write_node_folio.patch
 f2fs-fix-to-do-sanity-check-on-node-footer-in-read-write-_end_io.patch
+f2fs-fix-incomplete-block-usage-in-compact-ssa-summaries.patch