From 4459eb7bb42c1f920760d2ca5e147b81d04fdc00 Mon Sep 17 00:00:00 2001 From: Ayush Ranjan Date: Fri, 21 Aug 2020 20:04:31 -0700 Subject: [vfs] Allow mountpoint to be an existing non-directory. Unlike linux mount(2), OCI spec allows mounting on top of an existing non-directory file. PiperOrigin-RevId: 327914342 --- runsc/boot/vfs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runsc') diff --git a/runsc/boot/vfs.go b/runsc/boot/vfs.go index fb200e988..66b6cf19b 100644 --- a/runsc/boot/vfs.go +++ b/runsc/boot/vfs.go @@ -292,7 +292,7 @@ func (c *containerMounter) mountSubmountVFS2(ctx context.Context, conf *config.C return nil, nil } - if err := c.k.VFS().MkdirAllAt(ctx, submount.Destination, root, creds, &vfs.MkdirOptions{Mode: 0777, ForSyntheticMountpoint: true}); err != nil { + if err := c.k.VFS().MakeSyntheticMountpoint(ctx, submount.Destination, root, creds); err != nil { return nil, err } mnt, err := c.k.VFS().MountAt(ctx, creds, "", target, fsName, opts) @@ -496,7 +496,7 @@ func (c *containerMounter) mountSharedSubmountVFS2(ctx context.Context, conf *co root := mns.Root() defer root.DecRef(ctx) - if err := c.k.VFS().MkdirAllAt(ctx, mount.Destination, root, creds, &vfs.MkdirOptions{Mode: 0777, ForSyntheticMountpoint: true}); err != nil { + if err := c.k.VFS().MakeSyntheticMountpoint(ctx, mount.Destination, root, creds); err != nil { return nil, err } -- cgit v1.2.3