]> git.proxmox.com Git - pve-storage.git/commitdiff
lvmthin: Match snapshot remove regex to allowed names
authorDominic Jäger <d.jaeger@proxmox.com>
Wed, 28 Oct 2020 10:04:54 +0000 (11:04 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 16 Nov 2020 17:24:22 +0000 (18:24 +0100)
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 <h.laimer@proxmox.com>
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
PVE/Storage/LvmThinPlugin.pm

index d1c5b1f6c60d3292191be383bfc23303fd4cb63c..c9e127ce0cb5a170f991f8704dc3a9660c54e977 100644 (file)
@@ -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");
        }