* grub-core/disk/diskfilter.c (read_segment): Fix the case when disknr

falls on Q syndrom.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-04-26 12:51:03 +02:00
parent 5cb5387977
commit 4a3594c9b1
2 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2012-04-26 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/diskfilter.c (read_segment): Fix the case when disknr
falls on Q syndrom.
2012-04-26 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/nilfs2.c (grub_nilfs2_palloc_entry_offset_log):

View file

@ -723,8 +723,12 @@ read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector,
else
{
disknr -= seg->node_count;
if (disknr == p)
disknr += n;
if ((disknr >= p && disknr < p + n)
|| (disknr + seg->node_count >= p
&& disknr + seg->node_count < p + n))
disknr = p + n;
if (disknr >= seg->node_count)
disknr -= seg->node_count;
}
}
else