All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alasdair G Kergon <agk@redhat.com>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW lib/activate/activate.h lib/a ...
Date: Fri, 14 May 2010 00:47:11 +0100	[thread overview]
Message-ID: <20100513234711.GP2377@agk-dp.fab.redhat.com> (raw)
In-Reply-To: <20100513183841.1542.qmail@sourceware.org>

On Thu, May 13, 2010 at 06:38:41PM -0000, mbroz at sourceware.org wrote:
> +	/* Check internal lvm devices */
> +	if (is_reserved_lvname(name) && uuid &&
> +	    !strncmp(uuid, UUID_PREFIX, sizeof(UUID_PREFIX) - 1)) {
> +		log_debug("%s: Reserved internal LVM device not usable.", dev_name(dev));
> +		goto out;
> +	}

Mixing up types there.
name is a dm device name

is_reserved_lvname() accepts an lvname.

They are not the same thing.

E.g. A simple test gives me this bogus error:
  /dev/mapper/pvmove-lvol0: Reserved internal LVM device not usable.

Either perform a type conversion (e.g. using dm_split_lvm_name) or add a
specialist validation function (e.g. move the layer suffix checks out to
a separate shared fn and only pass the LV name part for checking; it
wouldn't be necessary to un-escape the hyphens, but you would have to
parse them properly to find the start of the LV name).

Another matter we need to consider is this:
     # If, while scanning the system for PVs, LVM2 encounters a device-mapper
     # device that has its I/O suspended, it waits for it to become accessible.
     # Set this to 1 to skip such devices.  This should only be needed
     # in recovery situations.
     ignore_suspended_devices = 0

i.e. The default is *disabled*.  (Well, dmeventd may always enable it of
course.)

But should the new check in this patch be independent of that setting and
be *always* enabled?

Alasdair



  reply	other threads:[~2010-05-13 23:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-13 18:38 LVM2 ./WHATS_NEW lib/activate/activate.h lib/a mbroz
2010-05-13 23:47 ` Alasdair G Kergon [this message]
2010-05-14  9:00   ` Milan Broz
2010-05-14  9:05     ` Zdenek Kabelac
  -- strict thread matches above, loose matches on Subject: below --
2010-04-23  2:57 snitzer

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=20100513234711.GP2377@agk-dp.fab.redhat.com \
    --to=agk@redhat.com \
    --cc=lvm-devel@redhat.com \
    /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.