1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

lv_manip: use lv_is_active

Updated reverted commit.
The usage of lv_is_active() is needed here, so the
(!lv_is_active_exclusive_locally) gives the correct
report.
This commit is contained in:
Zdenek Kabelac 2013-05-16 23:12:39 +02:00
parent 2ada982e73
commit 8cbacd2474

View File

@ -4394,8 +4394,6 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
struct logical_volume *pool_lv;
struct lv_list *lvl;
const char *thin_name = NULL;
int origin_active = 0;
struct lvinfo info;
if (new_lv_name && find_lv_in_vg(vg, new_lv_name)) {
log_error("Logical volume \"%s\" already exists in "
@ -4525,15 +4523,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
log_warn("WARNING: See global/mirror_segtype_default in lvm.conf.");
}
if (!lv_info(cmd, org, 0, &info, 0, 0)) {
log_error("Check for existence of active snapshot "
"origin '%s' failed.", org->name);
return NULL;
}
origin_active = info.exists;
if (vg_is_clustered(vg) &&
if (vg_is_clustered(vg) && lv_is_active(org) &&
!lv_is_active_exclusive_locally(org)) {
log_error("%s must be active exclusively to"
" create snapshot", org->name);