13985b0
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
13985b0
From: Javier Martinez Canillas <javierm@redhat.com>
13985b0
Date: Fri, 11 Jun 2021 00:01:29 +0200
13985b0
Subject: [PATCH] fs/ext2: Ignore checksum seed incompat feature
13985b0
13985b0
This incompat feature is used to denote that the filesystem stored its
13985b0
metadata checksum seed in the superblock. This is used to allow tune2fs
13985b0
to change the UUID on a mounted metadata_csum filesystem without having
13985b0
to rewrite all the disk metadata.
13985b0
13985b0
But GRUB doesn't use the metadata checksum in anyway, so can just ignore
13985b0
this feature if is enabled. This is consistent with GRUB filesystem code
13985b0
in general which just does a best effort to access the filesystem's data.
13985b0
13985b0
It may be removed from the ignored list in the future if supports to do
13985b0
metadata checksumming verification is added to the read-only FS driver.
13985b0
13985b0
Suggested-by: Eric Sandeen <esandeen@redhat.com>
13985b0
Suggested-by: Lukas Czerner <lczerner@redhat.com>
13985b0
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
13985b0
---
13985b0
 grub-core/fs/ext2.c | 10 +++++++++-
13985b0
 1 file changed, 9 insertions(+), 1 deletion(-)
13985b0
13985b0
diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c
e622855
index e7dd78e663..731d346f88 100644
13985b0
--- a/grub-core/fs/ext2.c
13985b0
+++ b/grub-core/fs/ext2.c
13985b0
@@ -103,6 +103,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
13985b0
 #define EXT4_FEATURE_INCOMPAT_64BIT		0x0080
13985b0
 #define EXT4_FEATURE_INCOMPAT_MMP		0x0100
13985b0
 #define EXT4_FEATURE_INCOMPAT_FLEX_BG		0x0200
13985b0
+#define EXT4_FEATURE_INCOMPAT_CSUM_SEED		0x2000
13985b0
 #define EXT4_FEATURE_INCOMPAT_ENCRYPT          0x10000
13985b0
 
13985b0
 /* The set of back-incompatible features this driver DOES support. Add (OR)
13985b0
@@ -123,9 +124,16 @@ GRUB_MOD_LICENSE ("GPLv3+");
13985b0
  * mmp:            Not really back-incompatible - was added as such to
13985b0
  *                 avoid multiple read-write mounts. Safe to ignore for this
13985b0
  *                 RO driver.
13985b0
+ * checksum seed:  Not really back-incompatible - was added to allow tools
13985b0
+ *                 such as tune2fs to change the UUID on a mounted metadata
13985b0
+ *                 checksummed filesystem. Safe to ignore for now since the
13985b0
+ *                 driver doesn't support checksum verification. But it must
13985b0
+ *                 be removed from this list if that support is added later.
13985b0
+ *
13985b0
  */
13985b0
 #define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \
13985b0
-				     | EXT4_FEATURE_INCOMPAT_MMP)
13985b0
+				     | EXT4_FEATURE_INCOMPAT_MMP \
13985b0
+				     | EXT4_FEATURE_INCOMPAT_CSUM_SEED)
13985b0
 
13985b0
 
13985b0
 #define EXT3_JOURNAL_MAGIC_NUMBER	0xc03b3998U