* floating point exception in disk/raid.c:206
@ 2008-09-04 9:29 Felix Zielcke
2008-09-04 19:22 ` Felix Zielcke
0 siblings, 1 reply; 3+ messages in thread
From: Felix Zielcke @ 2008-09-04 9:29 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 523 bytes --]
static grub_err_t
grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector,
grub_size_t size, char *buf)
case 0:
case 1:
case 10:
{
read_sector = grub_divmod64 (sector, array->chunk_size, &b);
Bean, this is a bit wrong because array->chunk_size is 0 in the RAID 1
case and sector is 0 too in the case I got with gdb.
The easiest fix would be probable to just set chunk_size to for example
64.
Attached patch does it, but maybe you have a better/other idea?
--
Felix Zielcke
[-- Attachment #2: fpe.raid.diff --]
[-- Type: text/x-patch, Size: 1350 bytes --]
2008-09-04 Felix Zielcke <fzielcke@z-51.de>
* disk/mdraid_linux.c (grub_mdraid_detect): Set `array->chunk_size' to 64
for RAID level 1.
* disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Likewise.
Index: disk/mdraid_linux.c
===================================================================
--- disk/mdraid_linux.c (Revision 1849)
+++ disk/mdraid_linux.c (Arbeitskopie)
@@ -200,7 +200,7 @@ grub_mdraid_detect (grub_disk_t disk, st
array->layout = sb.layout;
array->total_devs = sb.raid_disks;
array->disk_size = (sb.size) ? sb.size * 2 : sector;
- array->chunk_size = sb.chunk_size >> 9;
+ array->chunk_size = (sb.level == 1) ? 64 : sb.chunk_size >> 9;
array->index = sb.this_disk.number;
array->uuid_len = 16;
array->uuid = grub_malloc (16);
Index: disk/dmraid_nvidia.c
===================================================================
--- disk/dmraid_nvidia.c (Revision 1849)
+++ disk/dmraid_nvidia.c (Arbeitskopie)
@@ -135,7 +135,7 @@ grub_dmraid_nv_detect (grub_disk_t disk,
array->number = 0;
array->total_devs = sb.array.total_volumes;
- array->chunk_size = sb.array.stripe_block_size;
+ array->chunk_size = (array->level == 1) ? 64 : sb.array.stripe_block_size;
array->index = sb.unit_number;
array->uuid_len = sizeof (sb.array.signature);
array->uuid = grub_malloc (sizeof (sb.array.signature));
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: floating point exception in disk/raid.c:206
2008-09-04 9:29 floating point exception in disk/raid.c:206 Felix Zielcke
@ 2008-09-04 19:22 ` Felix Zielcke
2008-09-06 13:56 ` Felix Zielcke
0 siblings, 1 reply; 3+ messages in thread
From: Felix Zielcke @ 2008-09-04 19:22 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 347 bytes --]
Am Donnerstag, den 04.09.2008, 11:29 +0200 schrieb Felix Zielcke:
> The easiest fix would be probable to just set chunk_size to for example
> 64.
> Attached patch does it, but maybe you have a better/other idea?
Thanks to Bean on IRC.
I think this is now the right place to do it, at end of insert_array in
case of a new one.
--
Felix Zielcke
[-- Attachment #2: fpe.raid.diff.2 --]
[-- Type: text/plain, Size: 638 bytes --]
2008-09-04 Felix Zielcke <fzielcke@z-51.de>
* disk/raid.c (insert_array): Set `array->chunk_size' to 64 for
RAID level 1.
Index: disk/raid.c
===================================================================
--- disk/raid.c (Revision 1850)
+++ disk/raid.c (Arbeitskopie)
@@ -575,6 +575,11 @@ insert_array (grub_disk_t disk, struct g
/* Add our new array to the list. */
array->next = array_list;
array_list = array;
+
+ /* RAID 1 doestn't use a chunksize but code assumes one so set
+ one. */
+ if (array->level == 1)
+ array->chunk_size = 64;
}
/* Add the device to the array. */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: floating point exception in disk/raid.c:206
2008-09-04 19:22 ` Felix Zielcke
@ 2008-09-06 13:56 ` Felix Zielcke
0 siblings, 0 replies; 3+ messages in thread
From: Felix Zielcke @ 2008-09-06 13:56 UTC (permalink / raw)
To: The development of GRUB 2
Commited.
Am Donnerstag, den 04.09.2008, 21:22 +0200 schrieb Felix Zielcke:
> Am Donnerstag, den 04.09.2008, 11:29 +0200 schrieb Felix Zielcke:
>
> > The easiest fix would be probable to just set chunk_size to for example
> > 64.
> > Attached patch does it, but maybe you have a better/other idea?
>
> Thanks to Bean on IRC.
> I think this is now the right place to do it, at end of insert_array in
> case of a new one.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-09-06 13:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-04 9:29 floating point exception in disk/raid.c:206 Felix Zielcke
2008-09-04 19:22 ` Felix Zielcke
2008-09-06 13:56 ` Felix Zielcke
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.