]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
btrfs: fix super block offset in error message in btrfs_validate_super()
authorMark Harmstone <mark@harmstone.com>
Tue, 17 Feb 2026 17:35:42 +0000 (17:35 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2026 11:25:56 +0000 (13:25 +0200)
[ Upstream commit b52fe51f724385b3ed81e37e510a4a33107e8161 ]

Fix the superblock offset mismatch error message in
btrfs_validate_super(): we changed it so that it considers all the
superblocks, but the message still assumes we're only looking at the
first one.

The change from %u to %llu is because we're changing from a constant to
a u64.

Fixes: 069ec957c35e ("btrfs: Refactor btrfs_check_super_valid")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/disk-io.c

index 6d2dcd023cc6fe71cb27af83f3df86b0b36cd384..8df7eb7f01e90c978895e6cddc7136690437522b 100644 (file)
@@ -2503,8 +2503,8 @@ int btrfs_validate_super(const struct btrfs_fs_info *fs_info,
 
        if (mirror_num >= 0 &&
            btrfs_super_bytenr(sb) != btrfs_sb_offset(mirror_num)) {
-               btrfs_err(fs_info, "super offset mismatch %llu != %u",
-                         btrfs_super_bytenr(sb), BTRFS_SUPER_INFO_OFFSET);
+               btrfs_err(fs_info, "super offset mismatch %llu != %llu",
+                         btrfs_super_bytenr(sb), btrfs_sb_offset(mirror_num));
                ret = -EINVAL;
        }