On Tue, 2008-06-10 at 15:16 +0800, Bean wrote: > Hi, > > Ok, I fix some bugs, please see if the new patch works.
It doesn't work. i sent the logs privately. I also checked the logs and it looks like that GRUB is reading the log properly. Then I guess we are not using the log correctly. I changed fs/ext2.c to see how the results would differ if grub_fshelp_map_block() is bypassed: diff --git a/fs/ext2.c b/fs/ext2.c index ffe9e33..7b4bfd6 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -257,12 +257,24 @@ inline static grub_err_t grub_ext2_blockgroup (struct grub_ext2_data *data, int group, struct grub_ext2_block_group *blkgrp) { - return grub_disk_read (data->disk, - (grub_fshelp_map_block (data->journal, - grub_le_to_cpu32 (data->sblock.first_data_block) + 1) - << LOG2_EXT2_BLOCK_SIZE (data)), + grub_err_t ret; + int block; + + block = grub_le_to_cpu32 (data->sblock.first_data_block) + 1; + ret = grub_disk_read (data->disk, + block << LOG2_EXT2_BLOCK_SIZE (data), + group * sizeof (struct grub_ext2_block_group), + sizeof (struct grub_ext2_block_group), (char *) blkgrp); + grub_printf("direct: ret = %d, block = %d, inode_table_id = %d\n", ret, block, + blkgrp->inode_table_id); + block = grub_fshelp_map_block(data->journal, block); + ret = grub_disk_read (data->disk, + block << LOG2_EXT2_BLOCK_SIZE (data), group * sizeof (struct grub_ext2_block_group), sizeof (struct grub_ext2_block_group), (char *) blkgrp); + grub_printf("journal: ret = %d, block = %d, inode_table_id = %d\n", ret, block, + blkgrp->inode_table_id); + return ret; } That's the output: direct: ret = 0, block = 1, inode_table_id = 1027 journal: ret = 0, block = 1, inode_table_id = 1027 direct: ret = 0, block = 1, inode_table_id = 1027 journal: ret = 0, block = 17707, inode_table_id = 1027 direct: ret = 0, block = 1, inode_table_id = 1027 journal: ret = 0, block = 1, inode_table_id = 1027 direct: ret = 0, block = 1, inode_table_id = 1027 journal: ret = 0, block = 17707, inode_table_id = 1027 direct: ret = 0, block = 1, inode_table_id = 15237122 journal: ret = 0, block = 17707, inode_table_id = 6895416 So, originally we didn't have the journal opened, so the mapping was trivial, then 1 became mapped to 17707. But at some point the data in that block became different from what it used to be and different in the journaled and non-journaled blocks. -- Regards, Pavel Roskin _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel