nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0208-fs-ext2-Ignore-checksum-seed-incompat-feature.patch

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