1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cache: fix lock usage for cache conversion

Just like with lvcreate, this lvconvert case also need to properly
check which LV actually holds lock for cached origin - as it might
be i.e. thin-pool tdata subLV.
This commit is contained in:
Zdenek Kabelac 2018-03-08 10:30:46 +01:00
parent 7421252edc
commit ee37838b11

View File

@ -7384,6 +7384,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
struct logical_volume *lv, *origin_lv = NULL;
struct logical_volume *pool_lv = NULL;
struct logical_volume *tmp_lv;
const struct logical_volume *lock_lv;
struct lv_segment *seg, *pool_seg;
int thin_pool_was_active = -1; /* not scanned, inactive, active */
int historical;
@ -7547,11 +7548,12 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
}
/* Validate cache origin is exclusively active */
lock_lv = lv_lock_holder(origin_lv);
if (vg_is_clustered(origin_lv->vg) &&
locking_is_clustered() &&
locking_supports_remote_queries() &&
lv_is_active(origin_lv) &&
!lv_is_active_exclusive(origin_lv)) {
lv_is_active(lock_lv) &&
!lv_is_active_exclusive(lock_lv)) {
log_error("Cannot cache not exclusively active origin volume %s.",
display_lvname(origin_lv));
return NULL;