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

lvcreate: allow thin snapshot syntax that broke

The command "lvcreate --type thin --snapshot ..." to create a thin
snapshot would fail.

commit d651b340e6 removed the optional
"--type thin" from the command definition "lvcreate --snapshot LV_thin",
and added --type thin as AUTOTYPE.  This was correct and should not have
changed anything if all the command defs were correct, but it broke
the "lvcreate --type thin --snapshot" case.  It reveals a problem in a
different command definintion:  "lvcreate --type thin LV_thin" that was
missing --snapshot in its OO list.
This commit is contained in:
David Teigland 2023-06-20 15:41:24 -05:00
parent 1dbb86f8c7
commit ea6b5b694b
2 changed files with 23 additions and 3 deletions

View File

@ -74,5 +74,25 @@ lvcreate -L10M --zero n -T $vg/pool -V10M --name $lv1
mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
lvcreate -K -s $vg/$lv1 --name snap
fsck -n "$DM_DEV_DIR/$vg/snap"
vgchange -an $vg
lvremove -y $vg
# One thin pool and one thin LV
lvcreate --type thin-pool -L 10M -n tp $vg
lvcreate --type thin -n thin1 -V 20M --thinpool tp $vg
# Different syntaxes for creating a thin snapshot
lvcreate --type thin -n snap1 $vg/thin1
lvcreate --type thin --snapshot -n snap2 $vg/thin1
lvcreate --type thin --thin -n snap3 $vg/thin1
lvcreate --type thin --snapshot --thin -n snap4 $vg/thin1
lvcreate --snapshot -n snap5 $vg/thin1
lvcreate --thin -n snap6 $vg/thin1
# The command defs allow --snapshot --thin, but the internal
# lvcreate option checks disallow it. It doesn't seem to make
# sense to disallow this from a syntax point of view, but it's
# possible that the lvcreate implementation would do the wrong
# thing (that should probably be fixed.)
not lvcreate --thin --snapshot -n snap7 $vg/thin1
vgchange -an $vg
vgremove -ff $vg

View File

@ -1088,7 +1088,7 @@ AUTOTYPE: thin
---
lvcreate --type thin LV_thin
OO: --thin, OO_LVCREATE
OO: --thin, --snapshot, OO_LVCREATE
IO: --mirrors 0
ID: lvcreate_thin_snapshot
DESC: Create a thin LV that is a snapshot of an existing thin LV.
@ -1096,7 +1096,7 @@ FLAGS: SECONDARY_SYNTAX
# alternate form of lvcreate --type thin
lvcreate --thin LV_thin
OO: OO_LVCREATE
OO: --snapshot, OO_LVCREATE
IO: --mirrors 0
ID: lvcreate_thin_snapshot
DESC: Create a thin LV that is a snapshot of an existing thin LV.
@ -1105,7 +1105,7 @@ AUTOTYPE: thin
# alternate form of lvcreate --type thin
lvcreate --snapshot LV_thin
OO: OO_LVCREATE
OO: --thin, OO_LVCREATE
IO: --mirrors 0
ID: lvcreate_thin_snapshot
DESC: Create a thin LV that is a snapshot of an existing thin LV.