diff options
author | Jonathan Earl Brassow <jbrassow@redhat.com> | 2012-02-13 20:13:39 +0000 |
---|---|---|
committer | Jonathan Earl Brassow <jbrassow@redhat.com> | 2012-02-13 20:13:39 +0000 |
commit | ad48a46fc9df2ad75510a975c5b15535fc7da825 (patch) | |
tree | 337d704df8b122eeee01ebefac0f50ece14ddf27 /lib/raid/raid.c | |
parent | 96f82296ae357325580e1c8512942619750ba1e6 (diff) | |
download | lvm2-ad48a46fc9df2ad75510a975c5b15535fc7da825.tar.gz lvm2-ad48a46fc9df2ad75510a975c5b15535fc7da825.tar.xz lvm2-ad48a46fc9df2ad75510a975c5b15535fc7da825.zip |
Make conversion from a synced 'mirror' to 'raid1' not cause a full resync.
It was not possible to pass down the DM_[FORCE|NO]SYNC flags to
'dm_tree_node_add_raid_target'. This meant that converting to 'raid1' from
'mirror' would cause a full resync. (It also meant that '--nosync' was
ineffective when creating a 'raid1' LV.)
I've taken the 'reserved' parameter in 'dm_tree_node_add_raid_target' and
used it for the "flags" parameter. Now it is possible to pass the sync
flags and any other flags that may come up.
Diffstat (limited to 'lib/raid/raid.c')
-rw-r--r-- | lib/raid/raid.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/raid/raid.c b/lib/raid/raid.c index 3656dada..211f8070 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); |