From: Dietmar Maurer Date: Wed, 9 Dec 2015 06:44:12 +0000 (+0100) Subject: Revert "Mounting of zfspool snapshots are not necessary." X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=e84f7f5ddb0e89c2e1b24af68065a80a6712bdf0;p=pve-container.git Revert "Mounting of zfspool snapshots are not necessary." This reverts commit 258dad4af068fead7a41ba26e69d6bd5e497a1ff. For some unknown reason (zfs bug?), accessing .zfs/snapshot/snapname is not reliable. --- diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 38ce71c..6cef7b3 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -2172,11 +2172,16 @@ sub mountpoint_mount { if ($format eq 'subvol') { if ($mount_path) { if ($snapname) { - if ($scfg->{type} ne 'zfspool') { + 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 { 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') {