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

thin: external origins across thin-pool

Fix/support creation and usage of the external origin
across thin-pools - so thin LV can use thin LV from
some other thin-pool as external origin (read-only).
This commit is contained in:
Zdenek Kabelac 2024-02-23 20:52:51 +01:00
parent 27bdd038a8
commit edc91caffb

View File

@ -9587,8 +9587,11 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
/* Cache pool cannot be actived and zeroed */ /* Cache pool cannot be actived and zeroed */
log_very_verbose("Cache pool is prepared."); log_very_verbose("Cache pool is prepared.");
} else if (lv_is_thin_volume(lv)) { } else if (lv_is_thin_volume(lv)) {
/* For snapshot, suspend active thin origin first */ /* Optimize the case when taking a snapshot within same pool and thin origin
if (origin_lv && lv_is_thin_volume(origin_lv) && lv_is_active(origin_lv)) { * is an active LV, so we can pass thin message with suspend/resume of this LV. */
if (origin_lv && lv_is_thin_volume(origin_lv) &&
(first_seg(origin_lv)->pool_lv == pool_lv) &&
lv_is_active(origin_lv)) {
if (!(ret = suspend_lv_origin(cmd, origin_lv))) { if (!(ret = suspend_lv_origin(cmd, origin_lv))) {
log_error("Failed to suspend thin snapshot origin %s.", log_error("Failed to suspend thin snapshot origin %s.",
display_lvname(origin_lv)); display_lvname(origin_lv));