struct dev_manager *dm;
struct lvinfo info;
+ /* If mirrored LV is temporarily shrinked to 1 area (= linear),
+ * it should be considered in-sync. */
+ if (list_size(&lv->segments) == 1 && first_seg(lv)->area_count == 1) {
+ *percent = 100.0;
+ return 1;
+ }
+
if (!activation())
return 0;
list_iterate_items(seg, &lv_mirr->segments) {
denominator += seg->area_len;
- if (seg_is_mirrored(seg))
+ if (seg_is_mirrored(seg) && seg->area_count > 1)
numerator += seg->extents_copied;
else
numerator += seg->area_len;
mirr_state = *target_state;
+ /* Mirror segment could have only 1 area temporarily,
+ * if the segment is under conversion. */
+ if (seg->area_count == 1)
+ mirror_status = MIRR_DISABLED;
+
/*
* For pvmove, only have one mirror segment RUNNING at once.
* Segments before this are COMPLETED and use 2nd area.