]> git.proxmox.com Git - pve-container.git/commitdiff
fix bindmounting with staged mount points
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 26 Nov 2019 08:03:07 +0000 (09:03 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 26 Nov 2019 08:43:48 +0000 (09:43 +0100)
We still passed the target mount path to bindmount() causing
bindmount_verify() to fail. Fix this by assuming '/' as the
in-container target mount path when staging, as we mount
onto the $rootdir instead.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/PVE/LXC.pm

index 51091890db5c2444f0182bc4f188b0a804549b70..73e54cac0696703b6e6503b9bbb259e034849b45 100644 (file)
@@ -1519,8 +1519,12 @@ sub __mountpoint_mount {
        return undef;
     }
 
+    # When staging mount points we always mount to $rootdir directly (iow. as if `mp=/`).
+    # This is required since __mount_prepare_rootdir() will return handles to the parent directory
+    # which we use in __bindmount_verify()!
+    my $mount = $stage_mount ? '/': $mountpoint->{mp};
+
     my $volid = $mountpoint->{volume};
-    my $mount = $mountpoint->{mp};
     my $type = $mountpoint->{type};
     my $quota = !$snapname && !$mountpoint->{ro} && $mountpoint->{quota};
     my $mounted_dev;