1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvconvert: allow lvconvert --stripes/stripesize only with -mirrors/--repair/--thinpool

Also, update lvconvert man page to reflect this and make clear that
the --stripes/stripesize is applied to newly allocated space only.
This commit is contained in:
Peter Rajnoha 2012-12-11 15:50:25 +01:00
parent b38ba27083
commit cad22be394
3 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.99 - Version 2.02.99 -
=================================== ===================================
Allow lvconvert --stripes/stripesize only with --mirrors/--repair/--thinpool.
Fix memleak in device_is_usable mirror testing function. Fix memleak in device_is_usable mirror testing function.
Do not ignore -f in lvconvert --repair -y -f for mirror and raid volumes. Do not ignore -f in lvconvert --repair -y -f for mirror and raid volumes.
Disallow pvmove on RAID LVs until they are addressed properly Disallow pvmove on RAID LVs until they are addressed properly

View File

@ -61,6 +61,10 @@ lvconvert \- convert a logical volume from linear to mirror or snapshot
.sp .sp
.B lvconvert \-\-repair .B lvconvert \-\-repair
.RB [ \-h | \-? | \-\-help ] .RB [ \-h | \-? | \-\-help ]
.RB [ \-\-stripes
.I Stripes
.RB [ \-I | \-\-stripesize
.IR StripeSize ]]
.RB [ \-v | \-\-verbose ] .RB [ \-v | \-\-verbose ]
.RB [ \-\-version ] .RB [ \-\-version ]
.IR LogicalVolume [ Path ] .IR LogicalVolume [ Path ]
@ -274,7 +278,8 @@ This option is only available to RAID segment types
.BR \-\-stripes " " \fIStripes .BR \-\-stripes " " \fIStripes
Gives the number of stripes. Gives the number of stripes.
This is equal to the number of physical volumes to scatter This is equal to the number of physical volumes to scatter
the logical volume. the logical volume. This does not apply to existing allocated
space, only newly allocated space can be striped.
.TP .TP
.BR \-I ", " \-\-stripesize " " \fIStripeSize .BR \-I ", " \-\-stripesize " " \fIStripeSize
Gives the number of kilobytes for the granularity of the stripes. Gives the number of kilobytes for the granularity of the stripes.

View File

@ -167,6 +167,14 @@ static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd,
return 0; return 0;
} }
if ((arg_count(cmd, stripes_long_ARG) || arg_count(cmd, stripesize_ARG)) &&
!(arg_count(cmd, mirrors_ARG) || arg_count(cmd, repair_ARG) ||
arg_count(cmd, thinpool_ARG))) {
log_error("--stripes or --stripesize argument is only valid "
"with --mirrors, --repair or --thinpool");
return 0;
}
if (!arg_count(cmd, background_ARG)) if (!arg_count(cmd, background_ARG))
lp->wait_completion = 1; lp->wait_completion = 1;