diff --git a/WHATS_NEW b/WHATS_NEW index d0a0c2d34..0ce81fb11 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.118 - ================================= + Disable lvchange of major and minor of pool LVs. Fix pvscan --cache to not scan and read ignored metadata areas on PVs. Add After=iscsi-shutdown.service to blk-availability.service systemd unit. Disallow vgconvert from changing metadata format when lvmetad is used. diff --git a/man/lvchange.8.in b/man/lvchange.8.in index fbae9538c..6b41c8172 100644 --- a/man/lvchange.8.in +++ b/man/lvchange.8.in @@ -279,6 +279,7 @@ Do not use this if dmeventd is already monitoring a device. .TP .BR \-M ", " \-\-persistent " {" \fIy | \fIn } Set to y to make the minor number specified persistent. +Change of persistent numbers is not supported for pool volumes. .TP .BR \-p ", " \-\-permission " {" \fIr | \fIrw } Change access permission to read-only or read/write. diff --git a/test/shell/lvchange-cache.sh b/test/shell/lvchange-cache.sh index 9959f9385..20826fbb9 100644 --- a/test/shell/lvchange-cache.sh +++ b/test/shell/lvchange-cache.sh @@ -18,6 +18,10 @@ lvcreate --type cache-pool -an -v -L 2 -n cpool $vg lvcreate -H -L 4 -n corigin --cachepool $vg/cpool lvcreate -n noncache -l 1 $vg +# cannot change major minor for pools +not lvchange --yes -M y --minor 235 --major 253 $vg/cpool +not lvchange -M n $vg/cpool + not lvchange --cachepolicy mq $vg/noncache not lvchange --cachesettings foo=bar $vg/noncache diff --git a/test/shell/lvchange-thin.sh b/test/shell/lvchange-thin.sh index 4d3356330..87919bca2 100644 --- a/test/shell/lvchange-thin.sh +++ b/test/shell/lvchange-thin.sh @@ -54,8 +54,9 @@ lvchange -r auto $vg/$lv1 lvchange --yes -M y --minor 234 --major 253 $vg/$lv1 lvchange -M n $vg/$lv1 -lvchange --yes -M y --minor 235 --major 253 $vg/pool -lvchange -M n $vg/pool +# cannot change major minor for pools +not lvchange --yes -M y --minor 235 --major 253 $vg/pool +not lvchange -M n $vg/pool # addtag_ARG lvchange --addtag foo $vg/$lv1 diff --git a/tools/lvchange.c b/tools/lvchange.c index 5e90adcdf..096aae41e 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -966,6 +966,11 @@ static int _lvchange_single(struct cmd_context *cmd, struct logical_volume *lv, return ECMD_FAILED; } + if (arg_count(cmd, persistent_ARG) && lv_is_pool(lv)) { + log_error("Persistent major and minor numbers are not supported with pools."); + return ECMD_FAILED; + } + /* * FIXME: DEFAULT_BACKGROUND_POLLING should be "unspecified". * If --poll is explicitly provided use it; otherwise polling