[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <7c2b6e70-bdaf-ebcc-0b6f-7b1540f31953@redhat.com>
Date: Fri, 2 Mar 2018 10:45:38 -0600
From: Eric Sandeen <sandeen@...hat.com>
To: "linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>
Cc: Joakim Tjernlund <Joakim.Tjernlund@...inera.com>
Subject: [PATCH] ext4: don't complain about incorrect features when probing
If mount is auto-probing for filesystem type, it will try various
filesystems in order, with the MS_SILENT flag set. We get
that flag as the silent arg to ext4_fill_super.
If we're probing (silent==1) then don't complain about feature
incompatibilities that are found if it looks like it's actually
a different valid extN type - failed probes should be silent
in this case.
If the on-disk features are unknown even to ext4, then complain.
Reported-by: Joakim Tjernlund <Joakim.Tjernlund@...inera.com>
Signed-off-by: Eric Sandeen <sandeen@...hat.com>
---
compile-tested only, sorry.
Having 2 gotos like this might not be preferable, but trying
to write it more compactly led to what I thought was more
difficult-to-read logic.
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index b0915b7..66d8020 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3659,6 +3659,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
ext4_msg(sb, KERN_INFO, "mounting ext2 file system "
"using the ext4 subsystem");
else {
+ /*
+ * If we're probing be silent if this looks like
+ * it's actually an ext3/4 filesystem.
+ */
+ if (silent && ext4_feature_set_ok(sb))
+ goto failed_mount;
ext4_msg(sb, KERN_ERR, "couldn't mount as ext2 due "
"to feature incompatibilities");
goto failed_mount;
@@ -3670,6 +3676,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
ext4_msg(sb, KERN_INFO, "mounting ext3 file system "
"using the ext4 subsystem");
else {
+ /*
+ * If we're probing be silent if this looks like
+ * it's actually an ext4 filesystem.
+ */
+ if (silent && ext4_feature_set_ok(sb))
+ goto failed_mount;
ext4_msg(sb, KERN_ERR, "couldn't mount as ext3 due "
"to feature incompatibilities");
goto failed_mount;
Powered by blists - more mailing lists