diff options
author | Jamie Liu <jamieliu@google.com> | 2020-09-08 18:31:17 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-09-08 18:33:03 -0700 |
commit | 8d3551da6a41c30fa9c04a5b0cef712c089d5d04 (patch) | |
tree | a19f15c406def47529a400fb4e206b7d871a465f /pkg/sentry/fsimpl/kernfs/filesystem.go | |
parent | bca4d99a4bdeab0f7ef15ba39e64a54ce5b4485d (diff) |
Implement synthetic mountpoints for kernfs.
PiperOrigin-RevId: 330629897
Diffstat (limited to 'pkg/sentry/fsimpl/kernfs/filesystem.go')
-rw-r--r-- | pkg/sentry/fsimpl/kernfs/filesystem.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/kernfs/filesystem.go b/pkg/sentry/fsimpl/kernfs/filesystem.go index c428053e8..d7d3e8f48 100644 --- a/pkg/sentry/fsimpl/kernfs/filesystem.go +++ b/pkg/sentry/fsimpl/kernfs/filesystem.go @@ -360,7 +360,10 @@ func (fs *Filesystem) MkdirAt(ctx context.Context, rp *vfs.ResolvingPath, opts v defer rp.Mount().EndWrite() childVFSD, err := parentInode.NewDir(ctx, pc, opts) if err != nil { - return err + if !opts.ForSyntheticMountpoint || err == syserror.EEXIST { + return err + } + childVFSD = newSyntheticDirectory(rp.Credentials(), opts.Mode) } parentVFSD.Impl().(*Dentry).InsertChild(pc, childVFSD.Impl().(*Dentry)) return nil |