grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Bug fix for LVM


From: Bean
Subject: Re: [PATCH] Bug fix for LVM
Date: Sun, 19 Jul 2009 03:43:10 +0800

On Sun, Jul 19, 2009 at 3:11 AM, Robert Millan<address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]