From 9b6ff01b7925a1b6551cd7048f15eabcd4636f23 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Dominic=20J=C3=A4ger?= Date: Wed, 28 Oct 2020 11:04:54 +0100 Subject: [PATCH] lvmthin: Match snapshot remove regex to allowed names MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We allow snapshot names that match pve-configid but during qm destroy we have not removed all snapshots that match pve-configid so far. For example, the name x-y was allowed but the resulting snap_vm-105-disk-0_x-y was not removed. Reported-by: Hannes Laimer Signed-off-by: Dominic Jäger --- PVE/Storage/LvmThinPlugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/Storage/LvmThinPlugin.pm b/PVE/Storage/LvmThinPlugin.pm index d1c5b1f..c9e127c 100644 --- a/PVE/Storage/LvmThinPlugin.pm +++ b/PVE/Storage/LvmThinPlugin.pm @@ -117,7 +117,7 @@ sub free_image { # remove all volume snapshots first foreach my $lv (keys %$dat) { - next if $lv !~ m/^snap_${volname}_(\w+)$/; + next if $lv !~ m/^snap_${volname}_${PVE::JSONSchema::CONFIGID_RE}$/; my $cmd = ['/sbin/lvremove', '-f', "$vg/$lv"]; run_command($cmd, errmsg => "lvremove snapshot '$vg/$lv' error"); } -- 2.39.2