From ff4479581dcc1aec74e1988e8c0a043e6988ccf2 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 25 Jan 2012 15:09:00 +0100 Subject: [PATCH] * grub-core/fs/nilfs2.c (grub_nilfs2_load_sb): Use device size from first superblock to find the second one when possible. --- ChangeLog | 5 +++++ grub-core/fs/nilfs2.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c49e1046e..a497910a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-01-25 Vladimir Serbinenko + + * grub-core/fs/nilfs2.c (grub_nilfs2_load_sb): Use device size from + first superblock to find the second one when possible. + 2012-01-25 Vladimir Serbinenko * util/grub-install.in: Fix an ARC bug. diff --git a/grub-core/fs/nilfs2.c b/grub-core/fs/nilfs2.c index c2eecba2f..62611fedb 100644 --- a/grub-core/fs/nilfs2.c +++ b/grub-core/fs/nilfs2.c @@ -734,7 +734,11 @@ grub_nilfs2_load_sb (struct grub_nilfs2_data *data) /* Make sure if 1st super block is valid. */ valid[0] = grub_nilfs2_valid_sb (&data->sblock); - partition_size = grub_disk_get_size (disk); + if (valid[0]) + partition_size = (grub_le_to_cpu64 (data->sblock.s_dev_size) + >> GRUB_DISK_SECTOR_BITS); + else + partition_size = grub_disk_get_size (disk); if (partition_size != GRUB_DISK_SIZE_UNKNOWN) { /* Read second super block. */