[pve-devel] applied: [PATCH container] fix bindmounting with staged mount points

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Nov 26 09:47:29 CET 2019


On 11/26/19 9:03 AM, Wolfgang Bumiller wrote:
> 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 at proxmox.com>
> ---
>  src/PVE/LXC.pm | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
> index 5109189..73e54ca 100644
> --- a/src/PVE/LXC.pm
> +++ b/src/PVE/LXC.pm
> @@ -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;
> 

applied thanks!




More information about the pve-devel mailing list