[pve-devel] [PATCH pve-container] Mounting of zfspool snapshots are not necessary.

Wolfgang Link w.link at proxmox.com
Thu Nov 19 12:28:21 CET 2015


zfs subvol snapshots are allays mounted on $path_of_subvol/.zfs/$snapname
---
 src/PVE/LXC.pm | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index c61df23..aa705c8 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -2141,16 +2141,11 @@ sub mountpoint_mount {
 	if ($format eq 'subvol') {
 	    if ($mount_path) {
 		if ($snapname) {
-		    if ($scfg->{type} eq 'zfspool') {
-			my $path_arg = $path;
-			$path_arg =~ s!^/+!!;
-			PVE::Tools::run_command(['mount', '-o', 'ro', '-t', 'zfs', $path_arg, $mount_path]);
-		    } else {
+		    if ($scfg->{type} ne 'zfspool') {
 			die "cannot mount subvol snapshots for storage type '$scfg->{type}'\n";
 		    }
-		} else {
-		    PVE::Tools::run_command(['mount', '-o', 'bind', $path, $mount_path]);
 		}
+		PVE::Tools::run_command(['mount', '-o', 'bind', $path, $mount_path]);
 	    }
 	    return wantarray ? ($path, 0) : $path;
 	} elsif ($format eq 'raw' || $format eq 'iso') {
-- 
2.1.4




More information about the pve-devel mailing list