Skip to contentSkip to conversation

fs/ext2: Ignore checksum seed incompat feature support

PATCH In review Javier Martinez Canillas 4 participants 4 messages Jun 11, 2021 – Jul 7, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/ext2: Ignore checksum seed incompat feature support

This incompat feature is used to denote that the filesystem stored its metadata checksum seed in the superblock. This is used to allow tune2fs to change the UUID on a mounted metadata_csum filesystem without having to rewrite all the disk metadata.

But GRUB doesn't use the metadata checksum in anyway, so can just ignore this feature if is enabled. This is consistent with GRUB filesystem code in general which just does a best effort to access the filesystem's data.

It may be removed from the ignored list in the future if supports to do metadata checksumming verification is added to the read-only FS driver.

---

 grub-core/fs/ext2.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
grub-core/fs/ext2.c +9 -1
index 848bf939dba..238b2d76e38 100644
@@ -103,6 +103,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
 #define EXT4_FEATURE_INCOMPAT_64BIT		0x0080
 #define EXT4_FEATURE_INCOMPAT_MMP		0x0100
 #define EXT4_FEATURE_INCOMPAT_FLEX_BG		0x0200
+#define EXT4_FEATURE_INCOMPAT_CSUM_SEED		0x2000
 #define EXT4_FEATURE_INCOMPAT_ENCRYPT          0x10000
 
 /* The set of back-incompatible features this driver DOES support. Add (OR)
@@ -123,9 +124,16 @@ GRUB_MOD_LICENSE ("GPLv3+");
  * mmp:            Not really back-incompatible - was added as such to
  *                 avoid multiple read-write mounts. Safe to ignore for this
  *                 RO driver.
+ * checksum seed:  Not really back-incompatible - was added to allow tools
+ *                 such as tune2fs to change the UUID on a mounted metadata
+ *                 checksummed filesystem. Safe to ignore for now since the
+ *                 driver doesn't support checksum verification. But it must
+ *                 be removed from this list if that support is added later.
+ *
  */
 #define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \
-				     | EXT4_FEATURE_INCOMPAT_MMP)
+				     | EXT4_FEATURE_INCOMPAT_MMP \
+				     | EXT4_FEATURE_INCOMPAT_CSUM_SEED)
 
 
 #define EXT3_JOURNAL_MAGIC_NUMBER	0xc03b3998U
Signature · 1 line
2.31.1
#1 lore raw
Quoted 6 lines · * On 6/11/21 9:36 PM, Javier Martinez Canillas wrote:

This incompat feature is used to denote that the filesystem stored its metadata checksum seed in the superblock. This is used to allow tune2fs to change the UUID on a mounted metadata_csum filesystem without having to rewrite all the disk metadata.

But GRUB doesn't use the metadata checksum in anyway, so can just ignore

any way

Quoted 1 line

this feature if is enabled. This is consistent with GRUB filesystem code

if it is

Quoted 4 lines

in general which just does a best effort to access the filesystem's data.

It may be removed from the ignored list in the future if supports to do metadata checksumming verification is added to the read-only FS driver.

support
or better yet:
support for
metadata checksum verification

Mihai

Reviewed-by on v1 1/1
#2 lore raw
In reply to Javier Martinez Canillas
Quoted 11 lines · Javier Martinez Canillas

This incompat feature is used to denote that the filesystem stored its metadata checksum seed in the superblock. This is used to allow tune2fs to change the UUID on a mounted metadata_csum filesystem without having to rewrite all the disk metadata.

But GRUB doesn't use the metadata checksum in anyway, so can just ignore this feature if is enabled. This is consistent with GRUB filesystem code in general which just does a best effort to access the filesystem's data.

It may be removed from the ignored list in the future if supports to do metadata checksumming verification is added to the read-only FS driver.

Thanks,

you can add

-Lukas

Quoted 42 lines

---

 grub-core/fs/ext2.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
grub-core/fs/ext2.c +9 -1
index 848bf939dba..238b2d76e38 100644
@@ -103,6 +103,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
 #define EXT4_FEATURE_INCOMPAT_64BIT		0x0080
 #define EXT4_FEATURE_INCOMPAT_MMP		0x0100
 #define EXT4_FEATURE_INCOMPAT_FLEX_BG		0x0200
+#define EXT4_FEATURE_INCOMPAT_CSUM_SEED		0x2000
 #define EXT4_FEATURE_INCOMPAT_ENCRYPT          0x10000
 
 /* The set of back-incompatible features this driver DOES support. Add (OR)
@@ -123,9 +124,16 @@ GRUB_MOD_LICENSE ("GPLv3+");
  * mmp:            Not really back-incompatible - was added as such to
  *                 avoid multiple read-write mounts. Safe to ignore for this
  *                 RO driver.
+ * checksum seed:  Not really back-incompatible - was added to allow tools
+ *                 such as tune2fs to change the UUID on a mounted metadata
+ *                 checksummed filesystem. Safe to ignore for now since the
+ *                 driver doesn't support checksum verification. But it must
+ *                 be removed from this list if that support is added later.
+ *
  */
 #define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \
-				     | EXT4_FEATURE_INCOMPAT_MMP)
+				     | EXT4_FEATURE_INCOMPAT_MMP \
+				     | EXT4_FEATURE_INCOMPAT_CSUM_SEED)
 
 
 #define EXT3_JOURNAL_MAGIC_NUMBER	0xc03b3998U
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#3 lore raw
In reply to Javier Martinez Canillas
Quoted 9 lines · Javier Martinez Canillas

This incompat feature is used to denote that the filesystem stored its metadata checksum seed in the superblock. This is used to allow tune2fs to change the UUID on a mounted metadata_csum filesystem without having to rewrite all the disk metadata.

But GRUB doesn't use the metadata checksum in anyway, so can just ignore this feature if is enabled. This is consistent with GRUB filesystem code in general which just does a best effort to access the filesystem's data.

Quoted 6 lines

It may be removed from the ignored list in the future if supports to do metadata checksumming verification is added to the read-only FS driver.

Daniel