diff --git a/WHATS_NEW b/WHATS_NEW index 6df377862..c1060822a 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.46 - ================================ + Fix lv_is_visible to handle virtual origin. Introduce link_lv_to_vg and unlink_lv_from_vg functions. Remove lv_count from VG and use counter function instead. Fix snapshot segment import to not use duplicate segments & replace. diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c index e186dffb9..0509fe0a0 100644 --- a/lib/metadata/snapshot_manip.c +++ b/lib/metadata/snapshot_manip.c @@ -30,8 +30,15 @@ int lv_is_cow(const struct logical_volume *lv) int lv_is_visible(const struct logical_volume *lv) { - if (lv_is_cow(lv)) - return lv_is_visible(find_cow(lv)->lv); + if (lv->status & SNAPSHOT) + return 0; + + if (lv_is_cow(lv)) { + if (lv_is_virtual_origin(origin_from_cow(lv))) + return 1; + + return lv_is_visible(origin_from_cow(lv)); + } return lv->status & VISIBLE_LV ? 1 : 0; }