From 5042ea7e2cbdc0c04fd454583589a3b1e152f95d Mon Sep 17 00:00:00 2001 From: Jamie Liu Date: Thu, 23 Apr 2020 15:35:56 -0700 Subject: Add vfs.MkdirOptions.ForSyntheticMountpoint. PiperOrigin-RevId: 308143529 --- runsc/boot/vfs.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'runsc/boot') 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) } -- cgit v1.2.3