When deactivating origin, we may have possibly left table in broken state,
where origin is not active, but snapshot volume is still present.
Let's ensure deactivation of origin detects also all associated
snapshots are inactive - otherwise do not skip deactivation.
(so i.e. 'vgchange -an' would detect errors)
Version 2.02.112 -
=====================================
+ Deactivation of snapshot origin detects and deactivates left-over snapshots.
Properly report error when taking snapshot of any cache type LV.
Add basic thread debugging messages to dmeventd.
Include threads being shutdown in dmeventd device registration responses.
const struct logical_volume *lv_to_free = NULL;
struct lvinfo info;
static const struct lv_activate_opts laopts = { .skip_in_use = 1 };
+ struct dm_list *snh;
int r = 0;
if (!activation())
if (!info.exists) {
r = 1;
- goto out;
+ /* Check attached snapshot segments are also inactive */
+ dm_list_iterate(snh, &lv->snapshot_segs) {
+ if (!lv_info(cmd, dm_list_struct_base(snh, struct lv_segment, origin_list)->cow,
+ 0, &info, 0, 0))
+ goto_out;
+ if (info.exists) {
+ r = 0; /* Snapshot left in table? */
+ break;
+ }
+ }
+
+ if (r)
+ goto out;
}
if (lv_is_visible(lv) || lv_is_virtual_origin(lv) ||