]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-06-17 Vladimir Serbinenko <phcoder@gmail.com>
authorphcoder <phcoder@localhost>
Wed, 17 Jun 2009 13:15:33 +0000 (13:15 +0000)
committerphcoder <phcoder@localhost>
Wed, 17 Jun 2009 13:15:33 +0000 (13:15 +0000)
avoid double grub_adjust_range call. Bug reported by David Simner

* kern/disk.c (grub_disk_write): change to raw disk access before
calling disk_read

ChangeLog
kern/disk.c

index 6707e3ae9152ae8981022bda117397bcdea444a4..2254e5956ffcc785fa9f8c7aa8e157eda8eac575 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-06-17  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       avoid double grub_adjust_range call. Bug reported by David Simner
+
+       * kern/disk.c (grub_disk_write): change to raw disk access before
+       calling disk_read
+
 2009-06-17  Colin Watson  <cjwatson@ubuntu.com>
 
        * util/elf/grub-mkimage.c (usage): Prefix each option line with two
index ad778d44edf4f716e03fe83de51b2fec0d524874..0c54ed4679f3e4dec2bd4b8729d76ea4697e0956 100644 (file)
@@ -542,10 +542,17 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
        {
          char tmp_buf[GRUB_DISK_SECTOR_SIZE];
          grub_size_t len;
+         grub_partition_t part;
 
+         part = disk->partition;
+         disk->partition = 0;
          if (grub_disk_read (disk, sector, 0, GRUB_DISK_SECTOR_SIZE, tmp_buf)
              != GRUB_ERR_NONE)
-           goto finish;
+           {
+             disk->partition = part;
+             goto finish;
+           }
+         disk->partition = part;
 
          len = GRUB_DISK_SECTOR_SIZE - real_offset;
          if (len > size)