2007-03-18 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Sun, 18 Mar 2007 01:18:39 +0000 (01:18 +0000)
committerokuji <okuji@localhost>
Sun, 18 Mar 2007 01:18:39 +0000 (01:18 +0000)
    * 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
config.h.in
fs/ext2.c

index 1ae27ca..4235228 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-03-18  Yoshinori K. Okuji  <okuji@enbug.org>
+
+       * 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  <marco@gnu.org>
 
        * normal/main.c (read_config_file): When "menu" is not set, create
index 1aef212..c22d5b1 100644 (file)
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
-/* The size of `long', as computed by sizeof. */
+/* The size of `long', as computed by sizeof. */
 #undef SIZEOF_LONG
 
-/* The size of `void *', as computed by sizeof. */
+/* The size of `void *', as computed by sizeof. */
 #undef SIZEOF_VOID_P
 
 /* Define it to either start or _start */
index e69f2e0..6ff8d2d 100644 (file)
--- 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;