diff options
author | Ayush Ranjan <ayushranjan@google.com> | 2020-08-21 20:04:31 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-21 20:06:01 -0700 |
commit | 17bc5c1b00ce0bb9944507b40b4bb6968bcdbe75 (patch) | |
tree | c5c50046e9b3fdca9376634cd3d06d726da3c400 /runsc/boot | |
parent | 9607515aed13406a8550e8072cdaf53d4f1e437b (diff) |
[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
Diffstat (limited to 'runsc/boot')
-rw-r--r-- | runsc/boot/vfs.go | 4 |
1 files changed, 2 insertions, 2 deletions
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 } |