From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] Fix LVM/RAID probing without device.map
Date: Sat, 03 Apr 2010 01:11:44 +0200 [thread overview]
Message-ID: <4BB679B0.1070402@gmail.com> (raw)
In-Reply-To: <20100322142923.GD20777@riva.ucam.org>
[-- Attachment #1: Type: text/plain, Size: 1531 bytes --]
util/deviceiter.c is missing from your patch.
> @@ -136,6 +138,22 @@ probe (const char *path, char *device_na
> goto end;
> }
>
> + if (stat (dev_map, &dev_map_stat) == -1 &&
> + grub_util_get_dev_abstraction (device_name) != GRUB_DEV_ABSTRACTION_NONE)
>
Looks like it may call stat with NULL argument. I would rather avoid
doing this than rely on stat to detect it cleanly and not just segfault
> + {
> + /* If we don't have a device map, then we won't yet know about the
> + physical volumes underlying this device, so probe all devices. */
> + grub_util_iterate_devices (grub_util_biosdisk_probe_device, 0);
> +
> + /* Now reinitialise the higher layers. */
> + grub_lvm_fini ();
> + grub_mdraid_fini ();
> + grub_raid_fini ();
> + grub_raid_init ();
> + grub_mdraid_init ();
> + grub_lvm_init ();
>
Can we not to initialise those levels before they should be inited
rather than reinit? If it requires unclean workarounds I would rather
prefer this since it's relatively clean (approx rmmod+insmod)
> +int
> +grub_util_biosdisk_probe_device (const char *name, int is_floppy)
> +{
> + char *grub_disk;
> +
> + if (is_floppy)
> + grub_disk = xasprintf ("fd%d", num_fd++);
> + else
> + grub_disk = xasprintf ("hd%d", num_hd++);
> +
>
You can also choose something more straightforward for name generation.
Like just use 'name'.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]
next prev parent reply other threads:[~2010-04-02 23:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-22 14:29 [PATCH] Fix LVM/RAID probing without device.map Colin Watson
2010-04-02 23:11 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2010-04-02 23:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
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=4BB679B0.1070402@gmail.com \
--to=phcoder@gmail.com \
--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.