Check first the LV is cow before even checking it's a merging COW.
Note: previosly merging_cow was also merging origin, so without
this explicit check it used to return '1' also when passed
LV has been merging origin.
Version 2.02.155 -
================================
+ When checking LV is a merging COW, validate its a COW LV first.
Correcting value in copy_percent() for 100%.
Update vgreduce to use process_each_vg.
Update lvconvert to use process_each_lv.
int lv_is_merging_cow(const struct logical_volume *cow)
{
- struct lv_segment *snap_seg = find_snapshot(cow);
+ struct lv_segment *snap_seg;
+
+ if (!lv_is_cow(cow))
+ return 0;
+
+ snap_seg = find_snapshot(cow);
/* checks lv_segment's status to see if snapshot is merging */
return (snap_seg && (snap_seg->status & MERGING)) ? 1 : 0;