mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +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:
parent
7421252edc
commit
ee37838b11
@ -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 *lv, *origin_lv = NULL;
|
||||||
struct logical_volume *pool_lv = NULL;
|
struct logical_volume *pool_lv = NULL;
|
||||||
struct logical_volume *tmp_lv;
|
struct logical_volume *tmp_lv;
|
||||||
|
const struct logical_volume *lock_lv;
|
||||||
struct lv_segment *seg, *pool_seg;
|
struct lv_segment *seg, *pool_seg;
|
||||||
int thin_pool_was_active = -1; /* not scanned, inactive, active */
|
int thin_pool_was_active = -1; /* not scanned, inactive, active */
|
||||||
int historical;
|
int historical;
|
||||||
@ -7547,11 +7548,12 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Validate cache origin is exclusively active */
|
/* Validate cache origin is exclusively active */
|
||||||
|
lock_lv = lv_lock_holder(origin_lv);
|
||||||
if (vg_is_clustered(origin_lv->vg) &&
|
if (vg_is_clustered(origin_lv->vg) &&
|
||||||
locking_is_clustered() &&
|
locking_is_clustered() &&
|
||||||
locking_supports_remote_queries() &&
|
locking_supports_remote_queries() &&
|
||||||
lv_is_active(origin_lv) &&
|
lv_is_active(lock_lv) &&
|
||||||
!lv_is_active_exclusive(origin_lv)) {
|
!lv_is_active_exclusive(lock_lv)) {
|
||||||
log_error("Cannot cache not exclusively active origin volume %s.",
|
log_error("Cannot cache not exclusively active origin volume %s.",
|
||||||
display_lvname(origin_lv));
|
display_lvname(origin_lv));
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user