Skip to contentSkip to conversation

master - lvconvert: Don't allow --repair on raid0 LVs.

PATCH Alasdair Kergon 1 participant 1 message Aug 19, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=88e6abc5a091bbe8d826968eafe27936df0e260c
Commit:        88e6abc5a091bbe8d826968eafe27936df0e260c
Parent:        bf0eaafa6b81a271d40031b337c614bb9b56159a
Author:        Alasdair G Kergon <[email protected]>
AuthorDate:    Fri Aug 19 23:42:01 2016 +0100
Committer:     Alasdair G Kergon <[email protected]>
CommitterDate: Fri Aug 19 23:42:01 2016 +0100

lvconvert: Don't allow --repair on raid0 LVs.

---
 WHATS_NEW         |    1 +
 tools/lvconvert.c |    8 +++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)
WHATS_NEW +1 -0
index 764cc73..5a258c1 100644
@@ -1,5 +1,6 @@
 Version 2.02.165 - 
 ===================================
+  Don't allow lvconvert --repair on raid0 devices.
   No longer adjust incorrect number of raid stripes supplied to lvcreate.
   Move lcm and gcd to lib/misc.
   Suppress some unnecessary --stripesize parameter warnings.
tools/lvconvert.c +7 -1
index ac019ec..fefec7c 100644
@@ -1963,7 +1963,13 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
 			return 0;
 		}
 
-		if (!seg_is_striped(seg) && !lv_raid_percent(lv, &sync_percent)) {
+		if (seg_is_striped(seg)) {
+			log_error("Cannot repair LV %s of type raid0.",
+				  display_lvname(lv));
+			return 0;
+		}
+
+		if (!lv_raid_percent(lv, &sync_percent)) {
 			log_error("Unable to determine sync status of %s.",
 				  display_lvname(lv));
 			return 0;