From 12ccdb25e4dc975633d00d92fcc6f938bd82d2ce Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Fri, 28 Apr 2006 13:11:05 +0000 Subject: [PATCH] Require non-zero regionsize and document parameter on lvcreate man page. --- WHATS_NEW | 1 + man/lvcreate.8 | 5 +++++ tools/lvconvert.c | 6 ++++++ tools/lvcreate.c | 5 +++++ 4 files changed, 17 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index 79a096684..e5e3d0b93 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.06 - ================================= + Require non-zero regionsize and document parameter on lvcreate man page. Invalidate cache if composition of VG changed externally. Version 2.02.05 - 21st April 2006 diff --git a/man/lvcreate.8 b/man/lvcreate.8 index 276a46c0d..881cdc4c4 100644 --- a/man/lvcreate.8 +++ b/man/lvcreate.8 @@ -13,6 +13,7 @@ lvcreate \- create a logical volume in an existing volume group [\-M/\-\-persistent y/n] [\-\-minor minor] [\-n/\-\-name LogicalVolumeName] [\-p/\-\-permission r/rw] [\-r/\-\-readahead ReadAheadSectors] +[-R|--regionsize MirrorLogRegionSize] [\-t/\-\-test] [\-v/\-\-verbose] [\-Z/\-\-zero y/n] VolumeGroupName [PhysicalVolumePath...] @@ -91,6 +92,10 @@ Default is read and write. Set read ahead sector count of this logical volume to a value between 2 and 120. Ignored by device-mapper. .TP +.I \-R \-\-regionsize MirrorLogRegionSize +A mirror is divided into regions of this size (in KB), and the mirror log +uses this granularity to track which regions are in sync. +.TP .I \-s, \-\-snapshot Create a snapshot logical volume (or snapshot) for an existing, so called original logical volume (or origin). diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 611f2b4b3..9dc676cec 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -184,6 +184,12 @@ static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd, return 0; } + + if (!lp->region_size) { + log_error("Non-zero region size must be supplied."); + return 0; + } + if (!(lp->segtype = get_segtype_from_string(cmd, "striped"))) return_0; } diff --git a/tools/lvcreate.c b/tools/lvcreate.c index 5a429332c..dc26216f7 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -258,6 +258,11 @@ static int _read_mirror_params(struct lvcreate_params *lp, return 0; } + if (!lp->region_size) { + log_error("Non-zero region size must be supplied."); + return 0; + } + return 1; }