diff --git a/ChangeLog b/ChangeLog index 6707e3ae9..2254e5956 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-17 Vladimir Serbinenko + + 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 * util/elf/grub-mkimage.c (usage): Prefix each option line with two diff --git a/kern/disk.c b/kern/disk.c index ad778d44e..0c54ed467 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -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)