From: Milan Broz <mbroz@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Fix segfault when using vgsplit in stacked environment
Date: Mon, 09 Feb 2009 13:24:18 +0100 [thread overview]
Message-ID: <49902072.2000507@redhat.com> (raw)
In-Reply-To: <498FE109.6000103@redhat.com>
Peter Rajnoha wrote:
> diff --git a/lib/activate/activate.c b/lib/activate/activate.c
> index 2bc1db7..4ffd7bb 100644
> --- a/lib/activate/activate.c
> +++ b/lib/activate/activate.c
> @@ -1105,6 +1105,9 @@ int pv_uses_vg(struct physical_volume *pv,
> if (!activation())
> return 0;
>
> + if (!pv->dev || !pv->dev->dev)
> + return 1;
> +
(answering myself - why "return 1". the function name is misleading for me...)
/*
* Does PV use VG somewhere in its construction?
* Returns 1 on failure.
*/
int pv_uses_vg(struct physical_volume *pv,
struct volume_group *vg)
Please add something like this to cover it by testsuite
(best add it to already existing vgsplit tests):
. ./test-utils.sh
aux prepare_devs 3
pvcreate $devs
vgcreate $vg1 $dev1 $dev2
lvcreate -n $lv1 -l 100%FREE $vg1
#top VG
pvcreate $G_dev_/$vg1/$lv1
vgcreate $vg $G_dev_/$vg1/$lv1 $dev3
vgchange -a n $vg
vgchange -a n $vg1
# this should fail but not segfault
not vgsplit $vg $vg1 $dev3
Acked-by: Milan Broz <mbroz@redhat.com>
Tested-by: Milan Broz <mbroz@redhat.com>
Milan
--
mbroz at redhat.com
next prev parent reply other threads:[~2009-02-09 12:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-09 7:53 [PATCH] Fix segfault when using vgsplit in stacked environment Peter Rajnoha
2009-02-09 12:24 ` Milan Broz [this message]
2009-02-10 18:14 ` Alasdair G Kergon
2009-02-12 9:03 ` Peter Rajnoha
2009-02-16 22:10 ` Petr Rockai
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=49902072.2000507@redhat.com \
--to=mbroz@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.