diff options
author | Heinz Mauelshagen <heinzm@redhat.com> | 2017-04-06 00:47:34 +0200 |
---|---|---|
committer | Heinz Mauelshagen <heinzm@redhat.com> | 2017-04-06 00:47:34 +0200 |
commit | e350b83d508aca11969ad5429d1095fb2e066432 (patch) | |
tree | 9d0948af739afdfb06690635b1c6c16b2b43a3ed | |
parent | a8d5ada452570e1c9b0c6e0ae0a311870056896a (diff) | |
download | lvm2-e350b83d508aca11969ad5429d1095fb2e066432.tar.gz |
raid: reload on removing images
Requesting _raid_remove_images() to commit the
metadata missed to reload the origin causing a
kernel takeover error converting a 2-legged raid1
(with previously removed images) to raid5.
-rw-r--r-- | lib/metadata/raid_manip.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index 07bb13140..05cbb740d 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -1592,7 +1592,6 @@ static int _lv_free_reshape_space_with_status(struct logical_volume *lv, enum al */ if (!_lv_alloc_reshape_space(lv, alloc_end, &where, NULL)) return_0; - seg->extents_copied = first_seg(lv)->area_len; if (!lv_reduce(lv, total_reshape_len)) return_0; @@ -2918,6 +2917,8 @@ static int _raid_remove_images(struct logical_volume *lv, int yes, return 0; } + first_seg(lv)->area_count = new_count; + /* Convert to linear? */ if (new_count == 1) { if (!yes && yes_no_prompt("Are you sure you want to convert %s LV %s to type %s loosing all resilience? [y/n]: ", @@ -2944,13 +2945,11 @@ static int _raid_remove_images(struct logical_volume *lv, int yes, /* * Eliminate the extracted LVs */ - if (!dm_list_empty(removal_lvs)) { - if (!_deactivate_and_remove_lvs(lv->vg, removal_lvs)) - return_0; + if (!_deactivate_and_remove_lvs(lv->vg, removal_lvs)) + return_0; - if (!vg_write(lv->vg) || !vg_commit(lv->vg)) - return_0; - } + if (!lv_update_and_reload_origin(lv)) + return_0; backup(lv->vg); |