diff --git a/tools/command-lines.in b/tools/command-lines.in index b8050c925..6b155f79a 100644 --- a/tools/command-lines.in +++ b/tools/command-lines.in @@ -956,7 +956,8 @@ FLAGS: SECONDARY_SYNTAX # R14 (just --mirrors) # alternate form of lvcreate --type raid1|mirror lvcreate --mirrors PNumber --size SizeMB VG -OO: --stripesize SizeKB, --mirrorlog MirrorLog, --regionsize RegionSize, --minrecoveryrate SizeKB, --maxrecoveryrate SizeKB, OO_LVCREATE +OO: --stripesize SizeKB, --mirrorlog MirrorLog, --regionsize RegionSize, --minrecoveryrate SizeKB, --maxrecoveryrate SizeKB, +--raidintegrity Bool, --raidintegritymode String, --raidintegrityblocksize Number, OO_LVCREATE OP: PV ... IO: --stripes 1 ID: lvcreate_mirror_or_raid1 @@ -977,7 +978,8 @@ DESC: Create a raid LV (a specific raid level must be used, e.g. raid1). # FIXME: --mirrors N --stripes 1 is raid1|mirror and should only # match the cmd def above for raid1|mirror with IO: --stripes 1 lvcreate --mirrors PNumber --stripes Number --size SizeMB VG -OO: --stripesize SizeKB, --regionsize RegionSize, --minrecoveryrate SizeKB, --maxrecoveryrate SizeKB, OO_LVCREATE +OO: --stripesize SizeKB, --regionsize RegionSize, --minrecoveryrate SizeKB, --maxrecoveryrate SizeKB, +--raidintegrity Bool, --raidintegritymode String, --raidintegrityblocksize Number, OO_LVCREATE OP: PV ... ID: lvcreate_raid_any DESC: Create a raid10 LV. diff --git a/tools/lvcreate.c b/tools/lvcreate.c index 8b01999ea..0982002b2 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -607,6 +607,16 @@ static int _read_raid_params(struct cmd_context *cmd, } } + if (arg_int_value(cmd, raidintegrity_ARG, 0)) { + lp->raidintegrity = 1; + if (arg_is_set(cmd, raidintegrityblocksize_ARG)) + lp->integrity_settings.block_size = arg_int_value(cmd, raidintegrityblocksize_ARG, 0); + if (arg_is_set(cmd, raidintegritymode_ARG)) { + if (!integrity_mode_set(arg_str_value(cmd, raidintegritymode_ARG, NULL), &lp->integrity_settings)) + return_0; + } + } + return 1; } @@ -1286,16 +1296,6 @@ static int _lvcreate_params(struct cmd_context *cmd, } } - if (seg_is_raid(lp) && arg_int_value(cmd, raidintegrity_ARG, 0)) { - lp->raidintegrity = 1; - if (arg_is_set(cmd, raidintegrityblocksize_ARG)) - lp->integrity_settings.block_size = arg_int_value(cmd, raidintegrityblocksize_ARG, 0); - if (arg_is_set(cmd, raidintegritymode_ARG)) { - if (!integrity_mode_set(arg_str_value(cmd, raidintegritymode_ARG, NULL), &lp->integrity_settings)) - return_0; - } - } - lcp->pv_count = argc; lcp->pvs = argv;