summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/fs.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-04-29 13:13:51 -0700
committergVisor bot <gvisor-bot@google.com>2020-04-29 13:13:51 -0700
commitd5c34ba2ffef0b0aee38d4f96f06bc00b04b0a53 (patch)
tree8dd5bb4876c81d7f0ce44eb1e1c3e35b7ceec1b9 /runsc/boot/fs.go
parentce19497c1c0829af6ba56f0cc68e3a4cb33cf1c8 (diff)
parentfc53d6436776d5de052075e98f44417f04ced7e7 (diff)
Merge pull request #2487 from moricho:fix/bindmount
PiperOrigin-RevId: 309082540
Diffstat (limited to 'runsc/boot/fs.go')
-rw-r--r--runsc/boot/fs.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/runsc/boot/fs.go b/runsc/boot/fs.go
index 98cce60af..4875452e2 100644
--- a/runsc/boot/fs.go
+++ b/runsc/boot/fs.go
@@ -219,6 +219,9 @@ func mountFlags(opts []string) fs.MountSourceFlags {
mf.NoAtime = true
case "noexec":
mf.NoExec = true
+ case "bind", "rbind":
+ // When options include either "bind" or "rbind",
+ // it's converted to a 9P mount.
default:
log.Warningf("ignoring unknown mount option %q", o)
}
@@ -765,6 +768,16 @@ func (c *containerMounter) getMountNameAndOptions(conf *Config, m specs.Mount) (
useOverlay bool
)
+ for _, opt := range m.Options {
+ // When options include either "bind" or "rbind", this behaves as
+ // bind mount even if the mount type is equal to a filesystem supported
+ // on runsc.
+ if opt == "bind" || opt == "rbind" {
+ m.Type = bind
+ break
+ }
+ }
+
switch m.Type {
case devpts, devtmpfs, proc, sysfs:
fsName = m.Type