[pve-devel] applied: [PATCH container 2/2] delete_mp: warn if we ignore a volume deletion due to wrong owner

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Oct 18 12:52:54 CEST 2019


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/PVE/LXC.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 3921229..af6918a 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -731,7 +731,12 @@ sub delete_mountpoint_volume {
     return if PVE::LXC::Config->classify_mountpoint($volume) ne 'volume';
 
     my ($vtype, $name, $owner) = PVE::Storage::parse_volname($storage_cfg, $volume);
-    PVE::Storage::vdisk_free($storage_cfg, $volume) if $vmid == $owner;
+
+    if ($vmid == $owner) {
+	PVE::Storage::vdisk_free($storage_cfg, $volume);
+    } else {
+	warn "ignore deletion of '$volume', CT $vmid isn't the owner!\n";
+    }
 }
 
 sub destroy_lxc_container {
-- 
2.20.1





More information about the pve-devel mailing list