Lookup snapshot usage percent of origin volume when a snapshot is merging. --- WHATS_NEW | 1 + lib/activate/dev_manager.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) Index: lvm2/lib/activate/dev_manager.c =================================================================== --- lvm2.orig/lib/activate/dev_manager.c +++ lvm2/lib/activate/dev_manager.c @@ -742,6 +742,7 @@ int dev_manager_snapshot_percent(struct const struct logical_volume *lv, percent_t *percent) { + const struct logical_volume *snap_lv; char *name; const char *dlid; int fail_if_percent_unsupported = 0; @@ -761,13 +762,19 @@ int dev_manager_snapshot_percent(struct fail_if_percent_unsupported = 1; } + if (lv_is_merging_cow(lv)) { + /* must check percent of origin for a merging snapshot */ + snap_lv = origin_from_cow(lv); + } else + snap_lv = lv; + /* * Build a name for the top layer. */ - if (!(name = dm_build_dm_name(dm->mem, lv->vg->name, lv->name, NULL))) + if (!(name = dm_build_dm_name(dm->mem, snap_lv->vg->name, snap_lv->name, NULL))) return_0; - if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, NULL))) + if (!(dlid = build_dm_uuid(dm->mem, snap_lv->lvid.s, NULL))) return_0; /* Index: lvm2/WHATS_NEW =================================================================== --- lvm2.orig/WHATS_NEW +++ lvm2/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.89 - ================================== + Lookup snapshot usage percent of origin volume when a snapshot is merging. Update lvdisplay with backward compat. config opt. lvm1_compatible_display. Do not report linear segtype for non-striped targets. Keep info about creation host and time for each logical volume.