Skip to contentSkip to conversation

Stripes options with RAID1

PATCH New Marian Csontos 1 participant 3 messages Aug 22, 2017

lore
Share & tools
lore
#0 lore raw

v2 cover Stripes options with RAID1

Marian Csontos (2):
raid: stripes option is not allowed with RAID1
tests: Test stripes option with RAID1

 test/shell/lvconvert-raid.sh | 11 +++++++++++
 tools/lvconvert.c            |  5 +++--
 2 files changed, 14 insertions(+), 2 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v2 1/2 raid: stripes option is not allowed with RAID1

---
 tools/lvconvert.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/lvconvert.c +3 -2
index 94dee9d..4ca44763d 100644
@@ -209,10 +209,11 @@ static int _read_params(struct cmd_context *cmd, struct lvconvert_params *lp)
 		lp->type_str = SEG_TYPE_NAME_STRIPED;
 
 	if ((arg_is_set(cmd, stripes_long_ARG) || arg_is_set(cmd, stripesize_ARG)) &&
-	    !(_mirror_or_raid_type_requested(cmd, lp->type_str) || _striped_type_requested(lp->type_str) ||
+	    !((_mirror_or_raid_type_requested(cmd, lp->type_str) && strcmp(lp->type_str, SEG_TYPE_NAME_RAID1)) ||
+              _striped_type_requested(lp->type_str) ||
 	      _raid0_type_requested(lp->type_str) || arg_is_set(cmd, thinpool_ARG))) {
 		log_error("--stripes or --stripesize argument is only valid "
-			  "with --mirrors/--type mirror/--type raid*/--type striped/--type linear, --repair and --thinpool");
+			  "with --mirrors/--type mirror/--type raid{4,5,6,10}/--type striped/--type linear, --repair and --thinpool");
 		return 0;
 	}
 
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH v2 2/2 tests: Test stripes option with RAID1

In reply to Marian Csontos
---
 test/shell/lvconvert-raid.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)
test/shell/lvconvert-raid.sh +11 -0
index c5e6159..70ebc530 100644
@@ -100,6 +100,17 @@ done
 done
 
 ##############################################
+# RAID1 - stripes option not allowed
+##############################################
+lvcreate -aey -l 2 -n $lv1 $vg
+not lvconvert --type raid1 -y -m 1 --stripes 2 $vg/$lv1
+not lvconvert --type raid1 -y -m 1 --stripesize 64k $vg/$lv1
+not lvconvert --type raid1 -y -m 1 -I 64k $vg/$lv1
+# NOTE: -i is --interval not --stripe here!
+lvconvert --type raid1 -y -m 1 -i 2 $vg/$lv1
+lvremove -ff $vg
+
+##############################################
 # RAID1 - shouldn't be able to add image
 #         if created '--nosync', but should
 #         be able to after 'lvchange --resync'
Signature · 1 line
1.8.3.1