summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/fuse
diff options
context:
space:
mode:
authorRahat Mahmood <rahat@google.com>2021-03-11 16:47:49 -0800
committergVisor bot <gvisor-bot@google.com>2021-03-11 16:49:36 -0800
commitc5667022b6617d732e0c0bcb8ca3b58d588ceafb (patch)
treec112e83b4dcee9923cb99f1fe33b10251e1e58b2 /pkg/sentry/fsimpl/fuse
parenta82bd04e2ab3230a9ed09b297812b58d00784fe5 (diff)
Report filesystem-specific mount options.
PiperOrigin-RevId: 362406813
Diffstat (limited to 'pkg/sentry/fsimpl/fuse')
-rw-r--r--pkg/sentry/fsimpl/fuse/fusefs.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/fuse/fusefs.go b/pkg/sentry/fsimpl/fuse/fusefs.go
index 204d8d143..fb0ba2c6d 100644
--- a/pkg/sentry/fsimpl/fuse/fusefs.go
+++ b/pkg/sentry/fsimpl/fuse/fusefs.go
@@ -47,6 +47,9 @@ type FilesystemType struct{}
// +stateify savable
type filesystemOptions struct {
+ // mopts contains the raw, unparsed mount options passed to this filesystem.
+ mopts string
+
// userID specifies the numeric uid of the mount owner.
// This option should not be specified by the filesystem owner.
// It is set by libfuse (or, if libfuse is not used, must be set
@@ -108,7 +111,7 @@ func (fsType FilesystemType) GetFilesystem(ctx context.Context, vfsObj *vfs.Virt
return nil, nil, err
}
- var fsopts filesystemOptions
+ fsopts := filesystemOptions{mopts: opts.Data}
mopts := vfs.GenericParseMountOptions(opts.Data)
deviceDescriptorStr, ok := mopts["fd"]
if !ok {
@@ -260,6 +263,11 @@ func (fs *filesystem) Release(ctx context.Context) {
fs.Filesystem.Release(ctx)
}
+// MountOptions implements vfs.FilesystemImpl.MountOptions.
+func (fs *filesystem) MountOptions() string {
+ return fs.opts.mopts
+}
+
// inode implements kernfs.Inode.
//
// +stateify savable