FAILED: patch "[PATCH] f2fs: fix to update superblock crc in sanity_check_area_boundary()" failed to apply to 6.12-stable tree
Subsystems (2)
Sasha Levin
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x f8f956c7ec8c0285d7a80bed497d2f7adcbded15
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From f8f956c7ec8c0285d7a80bed497d2f7adcbded15 Mon Sep 17 00:00:00 2001
From: Chao Yu <[email protected]>
Date: Mon, 26 Oct 2026 08:23:50 +0800
Subject: [PATCH] f2fs: fix to update superblock crc in
sanity_check_area_boundary()
This patch fixes the bug reported by Sashiko:
We should update superblock crc along w/ raw_super->segment_count in sanity_check_area_boundary() if sb_checksum feature is enabled.
--- fs/f2fs/super.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/f2fs/super.c +6 -0
@@ -4084,6 +4084,12 @@ static inline bool sanity_check_area_boundary(struct f2fs_sb_info *sbi,/* fix in-memory information all the time */ raw_super->segment_count =cpu_to_le32 ((main_end_blkaddr - segment0_blkaddr) >> log_blocks_per_seg); +if (__F2FS_HAS_FEATURE (raw_super,F2FS_FEATURE_SB_CHKSUM )) { +__u32 crc =f2fs_crc32 (raw_super, + offsetof(struct f2fs_super_block , crc)); + + raw_super->crc =cpu_to_le32 (crc); + }if (f2fs_readonly (sb) ||f2fs_hw_is_readonly (sbi)) {set_sbi_flag (sbi,SBI_NEED_SB_WRITE );
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 f2fs: fix to update superblock crc in sanity_check_area_boundary()
From: Chao Yu <[email protected]>
[ Upstream commit f8f956c7ec8c0285d7a80bed497d2f7adcbded15 ]
This patch fixes the bug reported by Sashiko:
We should update superblock crc along w/ raw_super->segment_count in sanity_check_area_boundary() if sb_checksum feature is enabled.
--- fs/f2fs/super.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/f2fs/super.c +6 -0
@@ -3571,6 +3571,12 @@ static inline bool sanity_check_area_boundary(struct f2fs_sb_info *sbi,/* fix in-memory information all the time */ raw_super->segment_count =cpu_to_le32 ((main_end_blkaddr - segment0_blkaddr) >> log_blocks_per_seg); +if (__F2FS_HAS_FEATURE (raw_super,F2FS_FEATURE_SB_CHKSUM )) { +__u32 crc =f2fs_crc32 (sbi, raw_super, + offsetof(struct f2fs_super_block , crc)); + + raw_super->crc =cpu_to_le32 (crc); + }if (f2fs_readonly (sb) ||f2fs_hw_is_readonly (sbi)) {set_sbi_flag (sbi,SBI_NEED_SB_WRITE );
Signature · 1 line
2.53.0