]> git.proxmox.com Git - grub2.git/commitdiff
* grub-core/fs/nilfs2.c (grub_nilfs2_load_sb): Use device size from
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 25 Jan 2012 14:09:00 +0000 (15:09 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 25 Jan 2012 14:09:00 +0000 (15:09 +0100)
first superblock to find the second one when possible.

ChangeLog
grub-core/fs/nilfs2.c

index c49e1046ecbaa08960d2b8964a425a12bc6b5247..a497910a02bf93288bccd1bea3da1a2ba9ea3901 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-01-25  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * 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  <phcoder@gmail.com>
 
        * util/grub-install.in: Fix an ARC bug.
index c2eecba2f5e2299da3377b1780c4c3e837716636..62611fedbd4d3473928106e9a2f2e87ef197660b 100644 (file)
@@ -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. */