Skip to contentSkip to conversation

master - raid: report error when specified devices are not contained

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=61980bcf0624790bfdc07d371fd510d1c4079fb5
Commit:        61980bcf0624790bfdc07d371fd510d1c4079fb5
Parent:        31d153ced07dda004cff3a67a6e9a740b52253fd
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Wed Jun 21 11:45:20 2017 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Wed Jun 21 12:35:17 2017 +0200

raid: report error when specified devices are not contained

lvm2 always return non-zero error code when action cannot happen.

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