diff options
author | Jamie Liu <jamieliu@google.com> | 2020-09-08 18:31:17 -0700 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2020-09-09 17:53:10 -0700 |
commit | f9fa8b118f0f1e4a9fbe7fa5f5a367ba8105ddf0 (patch) | |
tree | 4f7890c91496c57410ca7a73c3b0ffccd1072b6e /pkg/sentry/fsimpl/kernfs/filesystem.go | |
parent | 397dc3ae5d2d4f836a7820a618c432ba49e4f4a7 (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 |