[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix LVM/RAID probing without device.map
From: |
Vladimir 'φ-coder/phcoder' Serbinenko |
Subject: |
Re: [PATCH] Fix LVM/RAID probing without device.map |
Date: |
Sat, 03 Apr 2010 01:11:44 +0200 |
User-agent: |
Mozilla-Thunderbird 2.0.0.22 (X11/20091109) |
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
signature.asc
Description: OpenPGP digital signature
- Re: [PATCH] Fix LVM/RAID probing without device.map,
Vladimir 'φ-coder/phcoder' Serbinenko <=