From: Wang Yugui <wangyugui@e16-tech.com>
To: linux-btrfs@vger.kernel.org
Cc: Wang Yugui <wangyugui@e16-tech.com>
Subject: [PATCH] fixup btrfs: relax block-group-tree feature dependency checks
Date: Fri, 23 Sep 2022 15:26:07 +0800 [thread overview]
Message-ID: <20220923072607.24584-1-wangyugui@e16-tech.com> (raw)
In-Reply-To: <20220923113120.DC30.409509F4@e16-tech.com>
btrfs misc-next broken fstest btrfs/056.
dmesg output of fstests btrfs/056 failure.
[ 658.119910] BTRFS error (device dm-0): cannot replay dirty log with unsupported compat_ro features (0x3), try rescue=nologreplay
there are 2 problems.
1) this error should not happen.
2) the message 'unsupported compat_ro features (0xXX)' should only output the unsupported part of compat_ro.
so fixup a4c79f3f1c2a (btrfs: relax block-group-tree feature dependency checks).
please fold it in because the orig patch is still in misc-next.
Signed-off-by: Wang Yugui <wangyugui@e16-tech.com>
---
fs/btrfs/disk-io.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index c10d368aed7b..9262d7af99b0 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3311,11 +3311,13 @@ int btrfs_check_features(struct btrfs_fs_info *fs_info, struct super_block *sb)
struct btrfs_super_block *disk_super = fs_info->super_copy;
u64 incompat = btrfs_super_incompat_flags(disk_super);
u64 compat_ro = btrfs_super_compat_ro_flags(disk_super);
+ u64 incompat_unsupp = incompat & ~BTRFS_FEATURE_INCOMPAT_SUPP;
+ u64 compat_ro_unsupp = compat_ro & ~BTRFS_FEATURE_COMPAT_RO_SUPP;
- if (incompat & ~BTRFS_FEATURE_INCOMPAT_SUPP) {
+ if (incompat_unsupp) {
btrfs_err(fs_info,
"cannot mount because of unknown incompat features (0x%llx)",
- incompat);
+ incompat_unsupp);
return -EINVAL;
}
@@ -3344,10 +3346,10 @@ int btrfs_check_features(struct btrfs_fs_info *fs_info, struct super_block *sb)
if (btrfs_super_nodesize(disk_super) > PAGE_SIZE)
incompat |= BTRFS_FEATURE_INCOMPAT_BIG_METADATA;
- if (compat_ro & ~BTRFS_FEATURE_COMPAT_RO_SUPP && !sb_rdonly(sb)) {
+ if (compat_ro_unsupp && !sb_rdonly(sb)) {
btrfs_err(fs_info,
"cannot mount read-write because of unknown compat_ro features (0x%llx)",
- compat_ro);
+ compat_ro_unsupp);
return -EINVAL;
}
@@ -3356,11 +3358,11 @@ int btrfs_check_features(struct btrfs_fs_info *fs_info, struct super_block *sb)
* should not cause any metadata writes, including log replay.
* Or we could screw up whatever the new feature requires.
*/
- if (compat_ro && btrfs_super_log_root(disk_super) &&
+ if (compat_ro_unsupp && btrfs_super_log_root(disk_super) &&
!btrfs_test_opt(fs_info, NOLOGREPLAY)) {
btrfs_err(fs_info,
"cannot replay dirty log with unsupported compat_ro features (0x%llx), try rescue=nologreplay",
- compat_ro);
+ compat_ro_unsupp);
return -EINVAL;
}
--
2.36.2
next prev parent reply other threads:[~2022-09-23 7:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-12 5:44 [PATCH] btrfs: loosen the block-group-tree feature dependency check Qu Wenruo
2022-09-20 23:40 ` Qu Wenruo
2022-09-21 9:46 ` David Sterba
2022-09-21 10:02 ` David Sterba
2022-09-23 3:31 ` Wang Yugui
2022-09-23 7:26 ` Wang Yugui [this message]
2022-09-23 8:23 ` [PATCH] fixup btrfs: relax block-group-tree feature dependency checks Qu Wenruo
2022-09-23 10:48 ` David Sterba
2022-09-23 8:27 ` [PATCH] btrfs: loosen the block-group-tree feature dependency check Qu Wenruo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220923072607.24584-1-wangyugui@e16-tech.com \
--to=wangyugui@e16-tech.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox