summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2020-04-23 15:35:56 -0700
committergVisor bot <gvisor-bot@google.com>2020-04-23 15:37:10 -0700
commit5042ea7e2cbdc0c04fd454583589a3b1e152f95d (patch)
treecc1c58e4f0b1176205a86358badfca4aa031610b /runsc/boot
parentcc5de905e628c5e9aca7e7a333d6dd9638719b6a (diff)
Add vfs.MkdirOptions.ForSyntheticMountpoint.
PiperOrigin-RevId: 308143529
Diffstat (limited to 'runsc/boot')
-rw-r--r--runsc/boot/vfs.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/runsc/boot/vfs.go b/runsc/boot/vfs.go
index 82083c57d..bce3a3593 100644
--- a/runsc/boot/vfs.go
+++ b/runsc/boot/vfs.go
@@ -251,6 +251,12 @@ func (c *containerMounter) mountSubmountVFS2(ctx context.Context, conf *Config,
// All writes go to upper, be paranoid and make lower readonly.
opts.ReadOnly = useOverlay
+ if err := c.k.VFS().MkdirAt(ctx, creds, target, &vfs.MkdirOptions{
+ ForSyntheticMountpoint: true,
+ }); err != nil && err != syserror.EEXIST {
+ // Log a warning, but attempt the mount anyway.
+ log.Warningf("Failed to create mount point at %q: %v", submount.Destination, err)
+ }
if err := c.k.VFS().MountAt(ctx, creds, "", target, submount.Type, opts); err != nil {
return fmt.Errorf("failed to mount %q (type: %s): %w, opts: %v", submount.Destination, submount.Type, err, opts)
}