From c5667022b6617d732e0c0bcb8ca3b58d588ceafb Mon Sep 17 00:00:00 2001 From: Rahat Mahmood Date: Thu, 11 Mar 2021 16:47:49 -0800 Subject: Report filesystem-specific mount options. PiperOrigin-RevId: 362406813 --- pkg/sentry/fsimpl/overlay/filesystem.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'pkg/sentry/fsimpl/overlay') diff --git a/pkg/sentry/fsimpl/overlay/filesystem.go b/pkg/sentry/fsimpl/overlay/filesystem.go index 917709d75..84e37f793 100644 --- a/pkg/sentry/fsimpl/overlay/filesystem.go +++ b/pkg/sentry/fsimpl/overlay/filesystem.go @@ -1764,3 +1764,15 @@ func (fs *filesystem) PrependPath(ctx context.Context, vfsroot, vd vfs.VirtualDe defer fs.renameMu.RUnlock() return genericPrependPath(vfsroot, vd.Mount(), vd.Dentry().Impl().(*dentry), b) } + +// MountOptions implements vfs.FilesystemImpl.MountOptions. +func (fs *filesystem) MountOptions() string { + // Return the mount options from the topmost layer. + var vd vfs.VirtualDentry + if fs.opts.UpperRoot.Ok() { + vd = fs.opts.UpperRoot + } else { + vd = fs.opts.LowerRoots[0] + } + return vd.Mount().Filesystem().Impl().MountOptions() +} -- cgit v1.2.3