All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Bug fix for LVM
Date: Sat, 18 Jul 2009 21:11:14 +0200	[thread overview]
Message-ID: <20090718191114.GK8867@thorin> (raw)
In-Reply-To: <ca0f59980907180711v43dd94d9ya9241873c8bd3f17@mail.gmail.com>

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?

>  #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
>        if (! grub_util_check_char_device (device_name))
> -        grub_util_error ("%s is not a character device.\n", device_name);
> +	grub_util_error ("%s is not a character device.\n", device_name);
>  #else
>        if (! grub_util_check_block_device (device_name))
> -        grub_util_error ("%s is not a block device.\n", device_name);
> +	grub_util_error ("%s is not a block device.\n", device_name);
>  #endif

Looks like this slipped in.

> +  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.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



  reply	other threads:[~2009-07-18 19:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-18 14:11 [PATCH] Bug fix for LVM Bean
2009-07-18 19:11 ` Robert Millan [this message]
2009-07-18 19:43   ` Bean
2009-07-18 19:57     ` Robert Millan
2009-07-18 19:59     ` Vladimir 'phcoder' Serbinenko
2009-07-18 20:05       ` Robert Millan
2009-07-19  9:41         ` Bean
2009-07-22 17:29           ` Robert Millan
2009-07-22 17:33           ` Robert Millan
2009-07-22 18:58             ` Bean
2009-07-25 16:05               ` Robert Millan
2009-07-19 19:11 ` Patrik Horník
2009-07-19 19:34   ` Bean
2009-07-25 20:37     ` Felix Zielcke
2009-07-27 20:58     ` Patrik Horník
2009-07-28  3:27       ` Bean
2009-07-28 13:57         ` Bean
2009-07-28 15:15           ` Bean
2009-07-28 15:16             ` Bean
2009-07-28 17:42             ` Robert Millan
2009-07-28 21:37               ` Felix Zielcke
2009-07-29  3:22               ` Bean
2009-07-31 15:44                 ` Robert Millan
2009-07-30 16:47             ` Patrik Horník
2009-07-31  4:41             ` Pavel Roskin
2009-07-31 14:28               ` Bean
2009-07-31 18:30                 ` Felix Zielcke
2009-08-06  7:07                   ` 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=20090718191114.GK8867@thorin \
    --to=rmh@aybabtu.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.