summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/fs.go
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2020-05-13 18:16:45 -0700
committergVisor bot <gvisor-bot@google.com>2020-05-13 18:18:09 -0700
commit64afaf0e9bb712938f3621b8588840b5398b883c (patch)
tree3323703669f08439c501786e4a77d2352a9cfd4b /runsc/boot/fs.go
parentdb655f020ea556524f0e341e538e81c16d4f95e7 (diff)
Fix runsc association of gofers and FDs on VFS2.
Updates #1487 PiperOrigin-RevId: 311443628
Diffstat (limited to 'runsc/boot/fs.go')
-rw-r--r--runsc/boot/fs.go22
1 files changed, 14 insertions, 8 deletions
diff --git a/runsc/boot/fs.go b/runsc/boot/fs.go
index 8df5cc989..e1181271a 100644
--- a/runsc/boot/fs.go
+++ b/runsc/boot/fs.go
@@ -770,14 +770,8 @@ 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
- }
+ if isBindMount(m) {
+ m.Type = bind
}
switch m.Type {
@@ -807,6 +801,18 @@ func (c *containerMounter) getMountNameAndOptions(conf *Config, m specs.Mount) (
return fsName, opts, useOverlay, nil
}
+func isBindMount(m specs.Mount) 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" {
+ return true
+ }
+ }
+ return false
+}
+
func (c *containerMounter) getMountAccessType(mount specs.Mount) FileAccessType {
if hint := c.hints.findMount(mount); hint != nil {
return hint.fileAccessType()