Annotation of /trunk/grub/patches/grub-2.06-e2fsprogs-1.47-fixes.patch
Parent Directory | Revision Log
Revision 3746 -
(hide annotations)
(download)
Fri Jul 28 10:15:07 2023 UTC (9 months, 4 weeks ago) by niro
File size: 6192 byte(s)
Fri Jul 28 10:15:07 2023 UTC (9 months, 4 weeks ago) by niro
File size: 6192 byte(s)
-e2fsprogs fixes
1 | niro | 3746 | Submitted By: Xi Ruoyao <xry111 AT xry111 DOT site> |
2 | Date: 2023-02-18 | ||
3 | Initial Package Version: 2.06 | ||
4 | Upstream Status: Committed | ||
5 | Origin: Upstream git repository, commit SHA follows: | ||
6 | 7fd5feff97c4b1f446f8fcf6d37aca0c64e7c763 | ||
7 | 2e9fa73a040462b81bfbfe56c0bc7ad2d30b446b | ||
8 | Description: Recognize ext2/3/4 filesystem features | ||
9 | metdata_csum_seed and large_dir; ignore them as | ||
10 | they are not used by GRUB and can be safely | ||
11 | ignored, instead of treat these unrecognized | ||
12 | features as hard errors. Particularly, the | ||
13 | metadata_csum_seed feature is enabled by | ||
14 | e2fsprogs >= 1.47.0, so failing to recognize it | ||
15 | will cause grub-install failure if the /boot | ||
16 | partition (or /, when /boot is not a separate | ||
17 | partition) is created by a recent mkfs.ext4. | ||
18 | |||
19 | From 7fd5feff97c4b1f446f8fcf6d37aca0c64e7c763 Mon Sep 17 00:00:00 2001 | ||
20 | From: Javier Martinez Canillas <javierm@redhat.com> | ||
21 | Date: Fri, 11 Jun 2021 21:36:16 +0200 | ||
22 | Subject: [PATCH] fs/ext2: Ignore checksum seed incompat feature | ||
23 | |||
24 | This incompat feature is used to denote that the filesystem stored its | ||
25 | metadata checksum seed in the superblock. This is used to allow tune2fs | ||
26 | changing the UUID on a mounted metdata_csum filesystem without having | ||
27 | to rewrite all the disk metadata. However, the GRUB doesn't use the | ||
28 | metadata checksum at all. So, it can just ignore this feature if it | ||
29 | is enabled. This is consistent with the GRUB filesystem code in general | ||
30 | which just does a best effort to access the filesystem's data. | ||
31 | |||
32 | The checksum seed incompat feature has to be removed from the ignore | ||
33 | list if the support for metadata checksum verification is added to the | ||
34 | GRUB ext2 driver later. | ||
35 | |||
36 | Suggested-by: Eric Sandeen <esandeen@redhat.com> | ||
37 | Suggested-by: Lukas Czerner <lczerner@redhat.com> | ||
38 | Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> | ||
39 | Reviewed-by: Lukas Czerner <lczerner@redhat.com> | ||
40 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
41 | --- | ||
42 | grub-core/fs/ext2.c | 10 ++++++++-- | ||
43 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
44 | |||
45 | diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c | ||
46 | index e7dd78e66..4953a1591 100644 | ||
47 | --- a/grub-core/fs/ext2.c | ||
48 | +++ b/grub-core/fs/ext2.c | ||
49 | @@ -103,6 +103,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); | ||
50 | #define EXT4_FEATURE_INCOMPAT_64BIT 0x0080 | ||
51 | #define EXT4_FEATURE_INCOMPAT_MMP 0x0100 | ||
52 | #define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200 | ||
53 | +#define EXT4_FEATURE_INCOMPAT_CSUM_SEED 0x2000 | ||
54 | #define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000 | ||
55 | |||
56 | /* The set of back-incompatible features this driver DOES support. Add (OR) | ||
57 | @@ -123,10 +124,15 @@ GRUB_MOD_LICENSE ("GPLv3+"); | ||
58 | * mmp: Not really back-incompatible - was added as such to | ||
59 | * avoid multiple read-write mounts. Safe to ignore for this | ||
60 | * RO driver. | ||
61 | + * checksum seed: Not really back-incompatible - was added to allow tools | ||
62 | + * such as tune2fs to change the UUID on a mounted metadata | ||
63 | + * checksummed filesystem. Safe to ignore for now since the | ||
64 | + * driver doesn't support checksum verification. However, it | ||
65 | + * has to be removed from this list if the support is added later. | ||
66 | */ | ||
67 | #define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \ | ||
68 | - | EXT4_FEATURE_INCOMPAT_MMP) | ||
69 | - | ||
70 | + | EXT4_FEATURE_INCOMPAT_MMP \ | ||
71 | + | EXT4_FEATURE_INCOMPAT_CSUM_SEED) | ||
72 | |||
73 | #define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U | ||
74 | |||
75 | -- | ||
76 | 2.39.2 | ||
77 | |||
78 | From 2e9fa73a040462b81bfbfe56c0bc7ad2d30b446b Mon Sep 17 00:00:00 2001 | ||
79 | From: Theodore Ts'o <tytso@mit.edu> | ||
80 | Date: Tue, 30 Aug 2022 22:41:59 -0400 | ||
81 | Subject: [PATCH] fs/ext2: Ignore the large_dir incompat feature | ||
82 | |||
83 | Recently, ext4 added the large_dir feature, which adds support for | ||
84 | a 3 level htree directory support. | ||
85 | |||
86 | The GRUB supports existing file systems with htree directories by | ||
87 | ignoring their existence, and since the index nodes for the hash tree | ||
88 | look like deleted directory entries (by design), the GRUB can simply do | ||
89 | a brute force O(n) linear search of directories. The same is true for | ||
90 | 3 level deep htrees indicated by large_dir feature flag. | ||
91 | |||
92 | Hence, it is safe for the GRUB to ignore the large_dir incompat feature. | ||
93 | |||
94 | Fixes: https://savannah.gnu.org/bugs/?61606 | ||
95 | |||
96 | Signed-off-by: Theodore Ts'o <tytso@mit.edu> | ||
97 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
98 | --- | ||
99 | grub-core/fs/ext2.c | 10 +++++++++- | ||
100 | 1 file changed, 9 insertions(+), 1 deletion(-) | ||
101 | |||
102 | diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c | ||
103 | index 0989e26e1..e1cc5e62a 100644 | ||
104 | --- a/grub-core/fs/ext2.c | ||
105 | +++ b/grub-core/fs/ext2.c | ||
106 | @@ -104,6 +104,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); | ||
107 | #define EXT4_FEATURE_INCOMPAT_MMP 0x0100 | ||
108 | #define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200 | ||
109 | #define EXT4_FEATURE_INCOMPAT_CSUM_SEED 0x2000 | ||
110 | +#define EXT4_FEATURE_INCOMPAT_LARGEDIR 0x4000 /* >2GB or 3 level htree */ | ||
111 | #define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000 | ||
112 | |||
113 | /* The set of back-incompatible features this driver DOES support. Add (OR) | ||
114 | @@ -129,10 +130,17 @@ GRUB_MOD_LICENSE ("GPLv3+"); | ||
115 | * checksummed filesystem. Safe to ignore for now since the | ||
116 | * driver doesn't support checksum verification. However, it | ||
117 | * has to be removed from this list if the support is added later. | ||
118 | + * large_dir: Not back-incompatible given that the GRUB ext2 driver does | ||
119 | + * not implement EXT2_FEATURE_COMPAT_DIR_INDEX. If the GRUB | ||
120 | + * eventually supports the htree feature (aka dir_index) | ||
121 | + * it should support 3 level htrees and then move | ||
122 | + * EXT4_FEATURE_INCOMPAT_LARGEDIR to | ||
123 | + * EXT2_DRIVER_SUPPORTED_INCOMPAT. | ||
124 | */ | ||
125 | #define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \ | ||
126 | | EXT4_FEATURE_INCOMPAT_MMP \ | ||
127 | - | EXT4_FEATURE_INCOMPAT_CSUM_SEED) | ||
128 | + | EXT4_FEATURE_INCOMPAT_CSUM_SEED \ | ||
129 | + | EXT4_FEATURE_INCOMPAT_LARGEDIR) | ||
130 | |||
131 | #define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U | ||
132 | |||
133 | -- | ||
134 | 2.39.2 | ||
135 |