* grub-core/disk/raid5_recover.c (grub_raid5_recover): Add missing

array->members[i].start_sector.
	* grub-core/disk/raid6_recover.c (grub_raid6_recover): Likewise.
This commit is contained in:
Doug Nazar 2011-01-07 14:41:44 +01:00 committed by Vladimir 'phcoder' Serbinenko
parent 014b68068d
commit 0ca09e6c52
3 changed files with 22 additions and 6 deletions

View file

@ -1,3 +1,9 @@
2011-01-07 Doug Nazar <nazard.michi@gmail.com>
* grub-core/disk/raid5_recover.c (grub_raid5_recover): Add missing
array->members[i].start_sector.
* grub-core/disk/raid6_recover.c (grub_raid6_recover): Likewise.
2011-01-07 Vladimir Serbinenko <phcoder@gmail.com> 2011-01-07 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-setup.c (setup): Handle NetBSD and OpenBSD disklabels. * util/grub-setup.c (setup): Handle NetBSD and OpenBSD disklabels.

View file

@ -45,7 +45,9 @@ grub_raid5_recover (struct grub_raid_array *array, int disknr,
if (i == disknr) if (i == disknr)
continue; continue;
err = grub_disk_read (array->members[i].device, sector, 0, size, buf2); err = grub_disk_read (array->members[i].device,
array->members[i].start_sector + sector,
0, size, buf2);
if (err) if (err)
{ {

View file

@ -119,7 +119,8 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p,
else else
{ {
if ((array->members[pos].device) && if ((array->members[pos].device) &&
(! grub_disk_read (array->members[pos].device, sector, (! grub_disk_read (array->members[pos].device,
array->members[i].start_sector + sector,
0, size, buf))) 0, size, buf)))
{ {
grub_raid_block_xor (pbuf, buf, size); grub_raid_block_xor (pbuf, buf, size);
@ -150,7 +151,9 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p,
{ {
/* One bad device */ /* One bad device */
if ((array->members[p].device) && if ((array->members[p].device) &&
(! grub_disk_read (array->members[p].device, sector, 0, size, buf))) (! grub_disk_read (array->members[p].device,
array->members[i].start_sector + sector,
0, size, buf)))
{ {
grub_raid_block_xor (buf, pbuf, size); grub_raid_block_xor (buf, pbuf, size);
goto quit; goto quit;
@ -163,7 +166,8 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p,
} }
grub_errno = GRUB_ERR_NONE; grub_errno = GRUB_ERR_NONE;
if (grub_disk_read (array->members[q].device, sector, 0, size, buf)) if (grub_disk_read (array->members[q].device,
array->members[i].start_sector + sector, 0, size, buf))
goto quit; goto quit;
grub_raid_block_xor (buf, qbuf, size); grub_raid_block_xor (buf, qbuf, size);
@ -181,12 +185,16 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p,
goto quit; goto quit;
} }
if (grub_disk_read (array->members[p].device, sector, 0, size, buf)) if (grub_disk_read (array->members[p].device,
array->members[i].start_sector + sector,
0, size, buf))
goto quit; goto quit;
grub_raid_block_xor (pbuf, buf, size); grub_raid_block_xor (pbuf, buf, size);
if (grub_disk_read (array->members[q].device, sector, 0, size, buf)) if (grub_disk_read (array->members[q].device,
array->members[i].start_sector + sector,
0, size, buf))
goto quit; goto quit;
grub_raid_block_xor (qbuf, buf, size); grub_raid_block_xor (qbuf, buf, size);