From: Felix Zielcke <fzielcke@z-51.de>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: floating point exception in disk/raid.c:206
Date: Thu, 04 Sep 2008 11:29:56 +0200 [thread overview]
Message-ID: <1220520596.4167.24.camel@fz.local> (raw)
[-- 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));
next reply other threads:[~2008-09-04 9:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-04 9:29 Felix Zielcke [this message]
2008-09-04 19:22 ` floating point exception in disk/raid.c:206 Felix Zielcke
2008-09-06 13:56 ` Felix Zielcke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1220520596.4167.24.camel@fz.local \
--to=fzielcke@z-51.de \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.