Skip to contentSkip to conversation

master - raid: update path for repair

PATCH Zdenek Kabelac 1 participant 1 message Jun 21, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=48f06005ab53420241e0c1da3a56a8f5c1a28974
Commit:        48f06005ab53420241e0c1da3a56a8f5c1a28974
Parent:        5f4cfa7c4a6da707354f8c1c059531dac5287192
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Wed Jun 21 13:57:22 2017 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Wed Jun 21 14:00:50 2017 +0200

raid: update path for repair

Updating path from commit 61980bcf0624790bfdc07d371fd510d1c4079fb5.

When repair is running, no removing PVS are given so it shall return success in such case.

---
 lib/metadata/raid_manip.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
lib/metadata/raid_manip.c +8 -3
index 34545b4..9e4f3a3 100644
@@ -6661,9 +6661,14 @@ static int _lv_raid_rebuild_or_replace(struct logical_volume *lv,
 	}
 
 	if (!match_count) {
-		log_error("Logical volume %s does not contain devices specified to %s.",
-			  display_lvname(lv), action_str);
-		return 0;
+		if (remove_pvs && !dm_list_empty(remove_pvs)) {
+			log_error("Logical volume %s does not contain devices specified to %s.",
+				  display_lvname(lv), action_str);
+			return 0;
+		}
+		log_print_unless_silent("%s does not contain devices specified to %s.",
+					display_lvname(lv), action_str);
+		return 1;
 	} else if (match_count == raid_seg->area_count) {
 		log_error("Unable to %s all PVs from %s at once.",
 			  action_str, display_lvname(lv));