From d70af616c2a481aafa37f644ee2e56aec53a2bc9 Mon Sep 17 00:00:00 2001 From: okuji Date: Sun, 18 Mar 2007 01:18:39 +0000 Subject: [PATCH] 2007-03-18 Yoshinori K. Okuji * fs/ext2.c (grub_ext2_read_inode): Use the inode size in a superblock instead of the structure size to compute an offset. This fixes the problem that GRUB could not read a filesystem when inode size is different from 128-byte. --- ChangeLog | 7 +++++++ config.h.in | 4 ++-- fs/ext2.c | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1ae27ca8e..423522841 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-03-18 Yoshinori K. Okuji + + * fs/ext2.c (grub_ext2_read_inode): Use the inode size in a + superblock instead of the structure size to compute an + offset. This fixes the problem that GRUB could not read a + filesystem when inode size is different from 128-byte. + 2007-03-05 Marco Gerards * normal/main.c (read_config_file): When "menu" is not set, create diff --git a/config.h.in b/config.h.in index 1aef2123b..c22d5b12b 100644 --- a/config.h.in +++ b/config.h.in @@ -88,10 +88,10 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* The size of `long', as computed by sizeof. */ +/* The size of a `long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The size of `void *', as computed by sizeof. */ +/* The size of a `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P /* Define it to either start or _start */ diff --git a/fs/ext2.c b/fs/ext2.c index e69f2e0c2..6ff8d2d53 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -294,7 +294,7 @@ grub_ext2_read_inode (struct grub_ext2_data *data, if (grub_disk_read (data->disk, ((grub_le_to_cpu32 (blkgrp.inode_table_id) + blkno) << LOG2_EXT2_BLOCK_SIZE (data)), - sizeof (struct grub_ext2_inode) * blkoff, + grub_le_to_cpu16 (sblock->inode_size) * blkoff, sizeof (struct grub_ext2_inode), (char *) inode)) return grub_errno;