summaryrefslogtreecommitdiffstats
path: root/tools/lvcreate.c
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2012-08-06 18:01:01 +0200
committerPeter Rajnoha <prajnoha@redhat.com>2012-08-06 18:01:01 +0200
commit6e55201144be3bcf82b6aafe7e9f7430318719d0 (patch)
treecca37992e2e0ebee0c006d7be0e62ee89a40b3d5 /tools/lvcreate.c
parent3843f54974ea7c3bbe51fcd681a55fc23f4e7736 (diff)
downloadlvm2-6e55201144be3bcf82b6aafe7e9f7430318719d0.tar.gz
lvm2-6e55201144be3bcf82b6aafe7e9f7430318719d0.tar.xz
lvm2-6e55201144be3bcf82b6aafe7e9f7430318719d0.zip
args: increase major:minor limit to 4095:1048575
Remove the limit for major and minor number arguments used while specifying persistent numbers via -My --major <major> --minor <minor> option which was set to 255 before. Follow the kernel limit instead which is 12 bits for major and 20 bits for minor number (kernel >= 2.6 and LVM formats that does not have FMT_RESTRICTED_LVIDS - so still keep the old limit of 255 for lvm1 format).
Diffstat (limited to 'tools/lvcreate.c')
-rw-r--r--tools/lvcreate.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index ab217cfb..48977d74 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -555,7 +555,8 @@ static int _read_raid_params(struct lvcreate_params *lp,
return 1;
}
-static int _read_activation_params(struct lvcreate_params *lp, struct cmd_context *cmd)
+static int _read_activation_params(struct lvcreate_params *lp, struct cmd_context *cmd,
+ struct volume_group *vg)
{
unsigned pagesize;
@@ -637,6 +638,8 @@ static int _read_activation_params(struct lvcreate_params *lp, struct cmd_contex
"--major when using -My");
return 0;
}
+ if (!major_minor_valid(cmd, vg->fid->fmt, lp->major, lp->minor))
+ return 0;
} else {
if ((lp->minor != -1) || (lp->major != -1)) {
log_error("--major and --minor incompatible "
@@ -1032,7 +1035,7 @@ int lvcreate(struct cmd_context *cmd, int argc, char **argv)
* Check activation parameters to support inactive thin snapshot creation
* FIXME: anything else needs to be moved past _determine_snapshot_type()?
*/
- if (!_read_activation_params(&lp, cmd)) {
+ if (!_read_activation_params(&lp, cmd, vg)) {
r = ECMD_FAILED;
goto_out;
}