diff --git a/WHATS_NEW b/WHATS_NEW index 6b9a310ca..6ab2b1954 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.169 - ===================================== + Improve search of lock-holder for external origin and thin-pool. Support status checking of cache volume used in layer. Avoid shifting by one number of blocks when clearing dirty cache volume. Extend metadata validation of external origin LV use count. diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c index 108414970..85879025a 100644 --- a/lib/metadata/lv.c +++ b/lib/metadata/lv.c @@ -1551,14 +1551,19 @@ const struct logical_volume *lv_lock_holder(const struct logical_volume *lv) if (lv_is_cow(lv)) return lv_lock_holder(origin_from_cow(lv)); - if (lv_is_thin_pool(lv)) { - /* Find any active LV from the pool */ - dm_list_iterate_items(sl, &lv->segs_using_this_lv) - if (lv_is_active(sl->seg->lv)) { - log_debug_activation("Thin volume %s is active.", - display_lvname(lv)); - return sl->seg->lv; - } + if (lv_is_thin_pool(lv) || + lv_is_external_origin(lv)) { + /* FIXME: Ensure cluster keeps thin-pool active exlusively. + * External origin can be activated on more nodes (depends on type). + */ + if (!lv_is_active(lv)) + /* Find any active LV from the pool or external origin */ + dm_list_iterate_items(sl, &lv->segs_using_this_lv) + if (lv_is_active(sl->seg->lv)) { + log_debug_activation("Thin volume %s is active.", + display_lvname(lv)); + return sl->seg->lv; + } return lv; } @@ -1573,9 +1578,6 @@ const struct logical_volume *lv_lock_holder(const struct logical_volume *lv) lv_is_thin_volume(sl->seg->lv) && first_seg(lv)->pool_lv == sl->seg->pool_lv) continue; /* Skip thin snaphost */ - if (lv_is_external_origin(lv) && - lv_is_thin_volume(sl->seg->lv)) - continue; /* Skip external origin */ if (lv_is_pending_delete(sl->seg->lv)) continue; /* Skip deleted LVs */ return lv_lock_holder(sl->seg->lv);