Skip to contentSkip to conversation

btrfs: fix error message in btrfs_validate_super()

PATCH In review Mark Harmstone 3 participants 3 messages Feb 17 – Feb 24 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: fix error message in btrfs_validate_super()

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")
---
 fs/btrfs/disk-io.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/disk-io.c +2 -2
index 600287ac8eb7..f39008591631 100644
@@ -2533,8 +2533,8 @@ int btrfs_validate_super(const struct btrfs_fs_info *fs_info,
 
 	if (unlikely(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;
 	}
 
Signature · 1 line
2.52.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Mark Harmstone

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")

Thanks,
Qu

Quoted 19 lines
---
  fs/btrfs/disk-io.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/disk-io.c +2 -2
index 600287ac8eb7..f39008591631 100644
@@ -2533,8 +2533,8 @@ int btrfs_validate_super(const struct btrfs_fs_info *fs_info,
 
  	if (unlikely(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;
  	}
 
#2 lore raw
In reply to Mark Harmstone
Quoted 10 lines · Mark Harmstone

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")

FYI I've edited the subjects of the error message fixing patches to be more specific what is being fixed now that there are a few of them.