[pve-devel] [PATCH 3/3] Prevent cleanup from unmount zfs subvols, if it is not a snapshot

Wolfgang Link w.link at proxmox.com
Tue Aug 25 13:24:53 CEST 2015


---
 src/PVE/VZDump/LXC.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm
index 4ee0e7c..12aae78 100644
--- a/src/PVE/VZDump/LXC.pm
+++ b/src/PVE/VZDump/LXC.pm
@@ -131,6 +131,7 @@ sub prepare {
 
 	if ($scfg->{type} ne 'zfs') {
 	    $diskinfo->{mountpoint} = $mountpoint;
+	    $diskinfo->{no_unmount} = 1;
 	} else {
 	    die "mode failure - storage does not support snapshot mount\n"
 	}
@@ -280,7 +281,7 @@ sub cleanup {
 
     my $di = $task->{diskinfo};
 
-    if ($task->{cleanup}->{snapshot_mount}) {
+    if ($task->{cleanup}->{snapshot_mount} && !$di->{no_unmount}) {
 	# Note: sleep to avoid 'device is busy' message.
 	# Seems Kernel need some time to cleanup open file list,
 	# for example when we stop the tar with kill (stop task)
-- 
2.1.4





More information about the pve-devel mailing list