On Sun, Jul 19, 2009 at 3:11 AM, Robert Millan<[email protected]> wrote:
> On Sat, Jul 18, 2009 at 10:11:19PM +0800, Bean wrote:
>> }
>>
>> grub_raid_rescan ();
>> + grub_lvm_fini ();
>> + grub_lvm_init ();
>
> This is aside from this patch, but I don't see the purpose of this
> grub_raid_rescan() function. It's in raid.mod but only used by
> grub-fstest, so at least it should be #ifdef'ed out, but looking at
> what it does, it seems very ad-hoc. It basically amounts to the
> same you're doing with grub_lvm_fini() and grub_lvm_init(). Could
> you fix this while at it?
This is required. As raid and lvm scan device in init function, but
grub-fstest uses loopback device, which hasn't been setup in
grub_init_all. This code rescan raid and lvm, otherwise there won't be
available.
>> + if (print == PRINT_ABSTRACTION)
>> + {
>> + char buf[30];
>
> This is a buffer overflow waiting to happen. Please use asprintf(), this
> will help you avoid the "&buf[1]" hack.
>
>> + grub_disk_memberlist_t list = NULL, tmp;
>> + int is_lvm = 0;
>> + int is_raid = 0;
>
> I think you can add const qualifier in the is_lvm one.
>
>> + is_lvm = (dev->disk->dev->id == GRUB_DISK_DEVICE_LVM_ID);
>> + is_raid |= (dev->disk->dev->id == GRUB_DISK_DEVICE_RAID_ID);
>
> No need for logic OR here.
Ok.
--
Bean
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel