Skip to content

Commit d672af4

Browse files
committed
Support ext4 fs with checksum seed feature.
1 parent 712f10e commit d672af4

File tree

1 file changed

+14
-5
lines changed
  • GRUB2/MOD_SRC/grub-2.04/grub-core/fs

1 file changed

+14
-5
lines changed

GRUB2/MOD_SRC/grub-2.04/grub-core/fs/ext2.c

+14-5
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
103103
#define EXT4_FEATURE_INCOMPAT_64BIT 0x0080
104104
#define EXT4_FEATURE_INCOMPAT_MMP 0x0100
105105
#define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200
106+
#define EXT4_FEATURE_INCOMPAT_CSUM_SEED 0x2000
106107
#define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000
107108

108109
/* The set of back-incompatible features this driver DOES support. Add (OR)
@@ -123,9 +124,16 @@ GRUB_MOD_LICENSE ("GPLv3+");
123124
* mmp: Not really back-incompatible - was added as such to
124125
* avoid multiple read-write mounts. Safe to ignore for this
125126
* RO driver.
127+
* checksum seed: Not really back-incompatible - was added to allow tools
128+
* such as tune2fs to change the UUID on a mounted metadata
129+
* checksummed filesystem. Safe to ignore for now since the
130+
* driver doesn't support checksum verification. But it must
131+
* be removed from this list if that support is added later.
132+
*
126133
*/
127134
#define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \
128-
| EXT4_FEATURE_INCOMPAT_MMP)
135+
| EXT4_FEATURE_INCOMPAT_MMP \
136+
| EXT4_FEATURE_INCOMPAT_CSUM_SEED)
129137

130138

131139
#define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U
@@ -723,10 +731,11 @@ grub_ext2_read_symlink (grub_fshelp_node_t node)
723731
if (! symlink)
724732
return 0;
725733

726-
/* If the filesize of the symlink is bigger than
727-
60 the symlink is stored in a separate block,
728-
otherwise it is stored in the inode. */
729-
if (grub_le_to_cpu32 (diro->inode.size) <= sizeof (diro->inode.symlink))
734+
/*
735+
* If the filesize of the symlink is equal to or bigger than 60 the symlink
736+
* is stored in a separate block, otherwise it is stored in the inode.
737+
*/
738+
if (grub_le_to_cpu32 (diro->inode.size) < sizeof (diro->inode.symlink))
730739
grub_memcpy (symlink,
731740
diro->inode.symlink,
732741
grub_le_to_cpu32 (diro->inode.size));

0 commit comments

Comments
 (0)