All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 2/2] Handle duplicate PVs on drbd
Date: Tue, 18 Mar 2014 10:10:32 +0100	[thread overview]
Message-ID: <53280D88.6000707@redhat.com> (raw)
In-Reply-To: <1395131042-5015-3-git-send-email-hare@suse.de>

Dne 18.3.2014 09:24, Hannes Reinecke napsal(a):
> From: Xinwei Hu <xwhu@suse.de>
>
> If lvm finds a duplicate PV where one device is a drbd device
> it should prefer the drbd device.
>
> Signed-off-by: Xinwei Hu <xwhu@suse.de>
> Acked-by: Hannes Reinecke <hare@suse.de>
> ---
>   lib/cache/lvmcache.c | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
> index d40bdce..ebc619b 100644
> --- a/lib/cache/lvmcache.c
> +++ b/lib/cache/lvmcache.c
> @@ -1503,6 +1503,14 @@ struct lvmcache_info *lvmcache_add(struct labeller *labeller, const char *pvid,
>   						 dev_subsystem_name(dt, existing->dev),
>   						 dev_name(existing->dev));
>   				return NULL;
> +			} else if (MAJOR(existing->dev->dev) == dt->drbd_major &&
> +					MAJOR(dev->dev) != dt->drbd_major) {
> +				log_very_verbose("Ignoring duplicate PV %s on "
> +						"%s - using drbd %s",
> +						pvid, dev_name(dev),
> +						dev_name(existing->dev));
> +				return NULL;
> +

Hi

I assume there is maybe wrong order of tests in functions:

dev_subsystem_part_major() &  dev_subsystem_name()  (in lib/device/dev-type.c)

Could you check if reordering tests would solve it ?
(I'm not familiar with drbd usage, however there is already code to handle 
this case - but maybe it's not working for all cases ?)

Zdenek



      reply	other threads:[~2014-03-18  9:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-18  8:24 [PATCH 0/2] Ancient SUSE patches Hannes Reinecke
2014-03-18  8:24 ` [PATCH 1/2] Fix pvdisplay to refer to sectors, not KB Hannes Reinecke
2014-03-18  8:57   ` Zdenek Kabelac
2014-03-18  9:11     ` Hannes Reinecke
2014-03-18  9:36       ` Zdenek Kabelac
2014-03-18  8:24 ` [PATCH 2/2] Handle duplicate PVs on drbd Hannes Reinecke
2014-03-18  9:10   ` Zdenek Kabelac [this message]

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=53280D88.6000707@redhat.com \
    --to=zkabelac@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.