summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2019-08-04 08:26:20 -0700
committerHelge Deller <deller@gmx.de>2019-08-05 10:48:52 +0200
commit4a2100277155525b1fa10faa427aaf1e25dd1adb (patch)
treef3902dfca01ceee0001dbfe37cf9a967bad45cbe
parent964bca53e3b53bde102a9d2af11e7da01e638c70 (diff)
downloadpalo-4a2100277155525b1fa10faa427aaf1e25dd1adb.tar.gz
ext2: fix ext4 group cache
The ext4 group cache is truncated because the read that populates it is assuming ext2 fixed group size and not using the ext4 variable group size. This only shows up with large inode numbers because the read stops before their contents is read. The upshot is when you try to do ext2_iget() for an ext4 inode above a certain number it fails because the group descriptor is random junk. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--ipl/ext2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipl/ext2.c b/ipl/ext2.c
index 96f6e4d..0729429 100644
--- a/ipl/ext2.c
+++ b/ipl/ext2.c
@@ -287,7 +287,7 @@ int ext2_mount(long cons_dev, long p_offset, long quiet)
if (Debug) printf("ext2 block size %d\n", ext2_blocksize);
/* read in the group descriptors (immediately follows superblock) */
- cons_read(dev, gds, ngroups * sizeof(struct ext2_group_desc),
+ cons_read(dev, gds, ngroups * group_size,
partition_offset +
ext2_blocksize * (EXT2_MIN_BLOCK_SIZE/ext2_blocksize + 1));
for (i = 0; i < ngroups; i++)