Skip to content

Commit d8ed2f9

Browse files
maharmstoneSasha Levin
authored andcommitted
btrfs: fix compat mask in error messages in btrfs_check_features()
[ Upstream commit 587bb33 ] Commit d7f67ac ("btrfs: relax block-group-tree feature dependency checks") introduced a regression when it comes to handling unsupported incompat or compat_ro flags. Beforehand we only printed the flags that we didn't recognize, afterwards we printed them all, which is less useful. Fix the error handling so it behaves like it used to. Fixes: d7f67ac ("btrfs: relax block-group-tree feature dependency checks") 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>
1 parent 17afe5c commit d8ed2f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/btrfs/disk-io.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3150,7 +3150,7 @@ int btrfs_check_features(struct btrfs_fs_info *fs_info, bool is_rw_mount)
31503150
if (incompat & ~BTRFS_FEATURE_INCOMPAT_SUPP) {
31513151
btrfs_err(fs_info,
31523152
"cannot mount because of unknown incompat features (0x%llx)",
3153-
incompat);
3153+
incompat & ~BTRFS_FEATURE_INCOMPAT_SUPP);
31543154
return -EINVAL;
31553155
}
31563156

@@ -3182,7 +3182,7 @@ int btrfs_check_features(struct btrfs_fs_info *fs_info, bool is_rw_mount)
31823182
if (compat_ro_unsupp && is_rw_mount) {
31833183
btrfs_err(fs_info,
31843184
"cannot mount read-write because of unknown compat_ro features (0x%llx)",
3185-
compat_ro);
3185+
compat_ro_unsupp);
31863186
return -EINVAL;
31873187
}
31883188

@@ -3195,7 +3195,7 @@ int btrfs_check_features(struct btrfs_fs_info *fs_info, bool is_rw_mount)
31953195
!btrfs_test_opt(fs_info, NOLOGREPLAY)) {
31963196
btrfs_err(fs_info,
31973197
"cannot replay dirty log with unsupported compat_ro features (0x%llx), try rescue=nologreplay",
3198-
compat_ro);
3198+
compat_ro_unsupp);
31993199
return -EINVAL;
32003200
}
32013201

0 commit comments

Comments
 (0)