diff --git a/WHATS_NEW b/WHATS_NEW index 37fe7ad05..6539f19b9 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.104 =================================== + Add workaround for deactivation problem of opened virtual snapshot. Disable unsupported merge for virtual snapshot. Move code to remove virtual snapshot from tools to lib for lvm2app. Fix possible race during daemon worker thread creation (lvmetad). diff --git a/lib/activate/activate.c b/lib/activate/activate.c index c077113a2..7621f4455 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -1929,7 +1929,7 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s, struct logical_vo goto out; } - if (lv_is_visible(lv)) { + if (lv_is_visible(lv) || lv_is_virtual_origin(lv)) { if (!lv_check_not_in_use(cmd, lv, &info)) goto_out; diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c index 325a4e8c3..fc1273e31 100644 --- a/lib/metadata/snapshot_manip.c +++ b/lib/metadata/snapshot_manip.c @@ -227,6 +227,16 @@ int vg_remove_snapshot(struct logical_volume *cow) struct logical_volume *origin = origin_from_cow(cow); int is_origin_active = lv_is_active(origin); + if (is_origin_active && + lv_is_virtual_origin(origin)) { + if (!deactivate_lv(origin->vg->cmd, origin)) { + log_error("Failed to deactivate logical volume \"%s\"", + origin->name); + return 0; + } + is_origin_active = 0; + } + dm_list_del(&cow->snapshot->origin_list); origin->origin_count--;