diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-09-21 05:38:20 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-09-21 05:38:20 +0000 |
commit | 88c6c5d6df320b543ac3c1355f5b0c0b4bd3eb8e (patch) | |
tree | 101e41977ebc64edaf3554543445ebef06bc9a08 /pkg/sentry/fsimpl/gofer | |
parent | e63e69b939d0634b4fe6e59644deeede6930ca82 (diff) | |
parent | e819029f3ad059bfc1635b7f2a196c332fa7532f (diff) |
Merge release-20210906.0-51-ge819029f3 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/gofer')
-rw-r--r-- | pkg/sentry/fsimpl/gofer/filesystem.go | 3 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/gofer/gofer.go | 13 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/gofer/gofer_state_autogen.go | 3 |
3 files changed, 19 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/gofer/filesystem.go b/pkg/sentry/fsimpl/gofer/filesystem.go index 00228c469..9d943bd4a 100644 --- a/pkg/sentry/fsimpl/gofer/filesystem.go +++ b/pkg/sentry/fsimpl/gofer/filesystem.go @@ -1612,6 +1612,9 @@ func (fs *filesystem) MountOptions() string { if fs.opts.overlayfsStaleRead { optsKV = append(optsKV, mopt{moptOverlayfsStaleRead, nil}) } + if fs.opts.lisaEnabled { + optsKV = append(optsKV, mopt{moptLisafs, nil}) + } opts := make([]string, 0, len(optsKV)) for _, opt := range optsKV { diff --git a/pkg/sentry/fsimpl/gofer/gofer.go b/pkg/sentry/fsimpl/gofer/gofer.go index 43440ec19..13971d086 100644 --- a/pkg/sentry/fsimpl/gofer/gofer.go +++ b/pkg/sentry/fsimpl/gofer/gofer.go @@ -83,6 +83,7 @@ const ( moptForcePageCache = "force_page_cache" moptLimitHostFDTranslation = "limit_host_fd_translation" moptOverlayfsStaleRead = "overlayfs_stale_read" + moptLisafs = "lisafs" ) // Valid values for the "cache" mount option. @@ -214,6 +215,10 @@ type filesystemOptions struct { // way that application FDs representing "special files" such as sockets // do. Note that this disables client caching and mmap for regular files. regularFilesUseSpecialFileFD bool + + // lisaEnabled indicates whether the client will use lisafs protocol to + // communicate with the server instead of 9P. + lisaEnabled bool } // InteropMode controls the client's interaction with other remote filesystem @@ -427,6 +432,14 @@ func (fstype FilesystemType) GetFilesystem(ctx context.Context, vfsObj *vfs.Virt delete(mopts, moptOverlayfsStaleRead) fsopts.overlayfsStaleRead = true } + if lisafs, ok := mopts[moptLisafs]; ok { + delete(mopts, moptLisafs) + fsopts.lisaEnabled, err = strconv.ParseBool(lisafs) + if err != nil { + ctx.Warningf("gofer.FilesystemType.GetFilesystem: invalid lisafs option: %s", lisafs) + return nil, nil, linuxerr.EINVAL + } + } // fsopts.regularFilesUseSpecialFileFD can only be enabled by specifying // "cache=none". diff --git a/pkg/sentry/fsimpl/gofer/gofer_state_autogen.go b/pkg/sentry/fsimpl/gofer/gofer_state_autogen.go index 756def82a..deed65b60 100644 --- a/pkg/sentry/fsimpl/gofer/gofer_state_autogen.go +++ b/pkg/sentry/fsimpl/gofer/gofer_state_autogen.go @@ -199,6 +199,7 @@ func (f *filesystemOptions) StateFields() []string { "limitHostFDTranslation", "overlayfsStaleRead", "regularFilesUseSpecialFileFD", + "lisaEnabled", } } @@ -219,6 +220,7 @@ func (f *filesystemOptions) StateSave(stateSinkObject state.Sink) { stateSinkObject.Save(9, &f.limitHostFDTranslation) stateSinkObject.Save(10, &f.overlayfsStaleRead) stateSinkObject.Save(11, &f.regularFilesUseSpecialFileFD) + stateSinkObject.Save(12, &f.lisaEnabled) } func (f *filesystemOptions) afterLoad() {} @@ -237,6 +239,7 @@ func (f *filesystemOptions) StateLoad(stateSourceObject state.Source) { stateSourceObject.Load(9, &f.limitHostFDTranslation) stateSourceObject.Load(10, &f.overlayfsStaleRead) stateSourceObject.Load(11, &f.regularFilesUseSpecialFileFD) + stateSourceObject.Load(12, &f.lisaEnabled) } func (i *InteropMode) StateTypeName() string { |