]> git.proxmox.com Git - pve-container.git/commitdiff
Revert "Mounting of zfspool snapshots are not necessary."
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 9 Dec 2015 06:44:12 +0000 (07:44 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 9 Dec 2015 07:08:24 +0000 (08:08 +0100)
This reverts commit 258dad4af068fead7a41ba26e69d6bd5e497a1ff.

For some unknown reason (zfs bug?), accessing .zfs/snapshot/snapname is
not reliable.

src/PVE/LXC.pm

index 38ce71cd0f5277bc936f8cc96c7e3d5d0a9442ba..6cef7b36cea3826901aaedad3f753a0c634c51bb 100644 (file)
@@ -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') {