summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/vfs/options.go
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2020-04-23 15:35:56 -0700
committergVisor bot <gvisor-bot@google.com>2020-04-23 15:37:10 -0700
commit5042ea7e2cbdc0c04fd454583589a3b1e152f95d (patch)
treecc1c58e4f0b1176205a86358badfca4aa031610b /pkg/sentry/vfs/options.go
parentcc5de905e628c5e9aca7e7a333d6dd9638719b6a (diff)
Add vfs.MkdirOptions.ForSyntheticMountpoint.
PiperOrigin-RevId: 308143529
Diffstat (limited to 'pkg/sentry/vfs/options.go')
-rw-r--r--pkg/sentry/vfs/options.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/sentry/vfs/options.go b/pkg/sentry/vfs/options.go
index 534528ce6..022bac127 100644
--- a/pkg/sentry/vfs/options.go
+++ b/pkg/sentry/vfs/options.go
@@ -33,6 +33,25 @@ type GetDentryOptions struct {
type MkdirOptions struct {
// Mode is the file mode bits for the created directory.
Mode linux.FileMode
+
+ // If ForSyntheticMountpoint is true, FilesystemImpl.MkdirAt() may create
+ // the given directory in memory only (as opposed to persistent storage).
+ // The created directory should be able to support the creation of
+ // subdirectories with ForSyntheticMountpoint == true. It does not need to
+ // support the creation of subdirectories with ForSyntheticMountpoint ==
+ // false, or files of other types.
+ //
+ // FilesystemImpls are permitted to ignore the ForSyntheticMountpoint
+ // option.
+ //
+ // The ForSyntheticMountpoint option exists because, unlike mount(2), the
+ // OCI Runtime Specification permits the specification of mount points that
+ // do not exist, under the expectation that container runtimes will create
+ // them. (More accurately, the OCI Runtime Specification completely fails
+ // to document this feature, but it's implemented by runc.)
+ // ForSyntheticMountpoint allows such mount points to be created even when
+ // the underlying persistent filesystem is immutable.
+ ForSyntheticMountpoint bool
}
// MknodOptions contains options to VirtualFilesystem.MknodAt() and