All of lore.kernel.org
 help / color / mirror / Atom feed
* master - raid: reload on removing images
@ 2017-04-05 22:59 Heinz Mauelshagen
  0 siblings, 0 replies; only message in thread
From: Heinz Mauelshagen @ 2017-04-05 22:59 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e350b83d508aca11969ad5429d1095fb2e066432
Commit:        e350b83d508aca11969ad5429d1095fb2e066432
Parent:        a8d5ada452570e1c9b0c6e0ae0a311870056896a
Author:        Heinz Mauelshagen <heinzm@redhat.com>
AuthorDate:    Thu Apr 6 00:47:34 2017 +0200
Committer:     Heinz Mauelshagen <heinzm@redhat.com>
CommitterDate: Thu Apr 6 00:47:34 2017 +0200

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.
---
 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 07bb131..05cbb74 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);
 



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-05 22:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05 22:59 master - raid: reload on removing images Heinz Mauelshagen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.