1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-09-30 17:44:21 +03:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Marian Csontos
1dace391a1 tests: Test stripes option with RAID1 2017-08-22 14:45:37 +02:00
Marian Csontos
445e9c48f8 raid: stripes option is not allowed with RAID1 2017-08-22 14:45:37 +02:00
2 changed files with 14 additions and 2 deletions

View File

@@ -99,6 +99,17 @@ for i in 1 2 3; do
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

View File

@@ -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;
}