[pve-devel] [PATCH] Prevent to unmap a non unmapped dev
Wolfgang Link
w.link at proxmox.com
Thu Sep 10 10:29:10 CEST 2015
---
PVE/Storage/RBDPlugin.pm | 3 +++
1 file changed, 3 insertions(+)
diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index ae6ed53..bf66682 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -511,6 +511,9 @@ sub deactivate_volume {
my $path = "/dev/rbd/$pool/$name";
my $cmd = &$rbd_cmd($scfg, $storeid, 'unmap', $path);
+
+ return if !(-b $path);
+
run_rbd_command($cmd, errmsg => "can't unmount rbd volume $name");
return 1;
--
2.1.4
More information about the pve-devel
mailing list