[lvm-devel] master - lvconvert: Don't allow --repair on raid0 LVs.

Alasdair Kergon agk at fedoraproject.org
Fri Aug 19 22:47:07 UTC 2016


Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=88e6abc5a091bbe8d826968eafe27936df0e260c
Commit:        88e6abc5a091bbe8d826968eafe27936df0e260c
Parent:        bf0eaafa6b81a271d40031b337c614bb9b56159a
Author:        Alasdair G Kergon <agk at redhat.com>
AuthorDate:    Fri Aug 19 23:42:01 2016 +0100
Committer:     Alasdair G Kergon <agk at redhat.com>
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(-)

diff --git a/WHATS_NEW b/WHATS_NEW
index 764cc73..5a258c1 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -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.
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index ac019ec..fefec7c 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -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;




More information about the lvm-devel mailing list