diff --git a/WHATS_NEW b/WHATS_NEW index 740c5dc82..74ae927f9 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.92 - ==================================== + Make conversion from a synced 'mirror' to 'raid1' not cause a full resync. Properly test buffer for unit check in units_to_bytes(). Add configure --with-systemdsystemunitdir. Add check for allocation failure in _build_matcher(). diff --git a/lib/raid/raid.c b/lib/raid/raid.c index 3656dada8..211f80706 100644 --- a/lib/raid/raid.c +++ b/lib/raid/raid.c @@ -159,6 +159,7 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)), uint32_t *pvmove_mirror_count __attribute__((unused))) { uint32_t s; + uint64_t flags = 0; uint64_t rebuilds = 0; if (!seg->area_count) { @@ -186,9 +187,12 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)), if (seg_lv(seg, s)->status & LV_REBUILD) rebuilds |= 1 << s; + if (mirror_in_sync()) + flags = DM_NOSYNC; + if (!dm_tree_node_add_raid_target(node, len, _raid_name(seg), seg->region_size, seg->stripe_size, - rebuilds, 0)) + rebuilds, flags)) return_0; return add_areas_line(dm, seg, node, 0u, seg->area_count); diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h index 4ebee2fb5..61a4374f7 100644 --- a/libdm/libdevmapper.h +++ b/libdm/libdevmapper.h @@ -548,7 +548,7 @@ int dm_tree_node_add_raid_target(struct dm_tree_node *node, uint32_t region_size, uint32_t stripe_size, uint64_t rebuilds, - uint64_t reserved2); + uint64_t flags); /* * Replicator operation mode diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index dabd72253..061331630 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -2751,7 +2751,7 @@ int dm_tree_node_add_raid_target(struct dm_tree_node *node, uint32_t region_size, uint32_t stripe_size, uint64_t rebuilds, - uint64_t reserved2) + uint64_t flags) { int i; struct load_segment *seg = NULL; @@ -2769,6 +2769,7 @@ int dm_tree_node_add_raid_target(struct dm_tree_node *node, seg->stripe_size = stripe_size; seg->area_count = 0; seg->rebuilds = rebuilds; + seg->flags = flags; return 1; }