2
1

0019-fs-ext2-Ignore-checksum-seed-incompat-feature.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. From 7fd5feff97c4b1f446f8fcf6d37aca0c64e7c763 Mon Sep 17 00:00:00 2001
  2. From: Javier Martinez Canillas <javierm@redhat.com>
  3. Date: Fri, 11 Jun 2021 21:36:16 +0200
  4. Subject: [PATCH] fs/ext2: Ignore checksum seed incompat feature
  5. This incompat feature is used to denote that the filesystem stored its
  6. metadata checksum seed in the superblock. This is used to allow tune2fs
  7. changing the UUID on a mounted metdata_csum filesystem without having
  8. to rewrite all the disk metadata. However, the GRUB doesn't use the
  9. metadata checksum at all. So, it can just ignore this feature if it
  10. is enabled. This is consistent with the GRUB filesystem code in general
  11. which just does a best effort to access the filesystem's data.
  12. The checksum seed incompat feature has to be removed from the ignore
  13. list if the support for metadata checksum verification is added to the
  14. GRUB ext2 driver later.
  15. Suggested-by: Eric Sandeen <esandeen@redhat.com>
  16. Suggested-by: Lukas Czerner <lczerner@redhat.com>
  17. Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
  18. Reviewed-by: Lukas Czerner <lczerner@redhat.com>
  19. Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
  20. Upstream: 7fd5feff97c4b1f446f8fcf6d37aca0c64e7c763
  21. Signed-off-by: Jens Maus <mail@jens-maus.de>
  22. ---
  23. grub-core/fs/ext2.c | 10 ++++++++--
  24. 1 file changed, 8 insertions(+), 2 deletions(-)
  25. diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c
  26. index e7dd78e66..4953a1591 100644
  27. --- a/grub-core/fs/ext2.c
  28. +++ b/grub-core/fs/ext2.c
  29. @@ -103,6 +103,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
  30. #define EXT4_FEATURE_INCOMPAT_64BIT 0x0080
  31. #define EXT4_FEATURE_INCOMPAT_MMP 0x0100
  32. #define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200
  33. +#define EXT4_FEATURE_INCOMPAT_CSUM_SEED 0x2000
  34. #define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000
  35. /* The set of back-incompatible features this driver DOES support. Add (OR)
  36. @@ -123,10 +124,15 @@ GRUB_MOD_LICENSE ("GPLv3+");
  37. * mmp: Not really back-incompatible - was added as such to
  38. * avoid multiple read-write mounts. Safe to ignore for this
  39. * RO driver.
  40. + * checksum seed: Not really back-incompatible - was added to allow tools
  41. + * such as tune2fs to change the UUID on a mounted metadata
  42. + * checksummed filesystem. Safe to ignore for now since the
  43. + * driver doesn't support checksum verification. However, it
  44. + * has to be removed from this list if the support is added later.
  45. */
  46. #define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \
  47. - | EXT4_FEATURE_INCOMPAT_MMP)
  48. -
  49. + | EXT4_FEATURE_INCOMPAT_MMP \
  50. + | EXT4_FEATURE_INCOMPAT_CSUM_SEED)
  51. #define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U
  52. --
  53. 2.34.1