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