summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-10-19 23:58:52 +0000
committergVisor bot <gvisor-bot@google.com>2021-10-19 23:58:52 +0000
commite5f195405e7b5523f68fe397a5393979f6960019 (patch)
treec3eff7de2648b2fe102e849023634db7e467fb16 /pkg/sentry
parent83d15c722c37a76bc7259f4ba1a6134218f710ca (diff)
parent1b494b80f02774ee109ccb7e20d9c2fe59b8cf72 (diff)
Merge release-20211011.0-34-g1b494b80f (automated)
Diffstat (limited to 'pkg/sentry')
-rw-r--r--pkg/sentry/fsimpl/gofer/filesystem.go29
1 files changed, 17 insertions, 12 deletions
diff --git a/pkg/sentry/fsimpl/gofer/filesystem.go b/pkg/sentry/fsimpl/gofer/filesystem.go
index cf6b34cbf..23c8b8ce3 100644
--- a/pkg/sentry/fsimpl/gofer/filesystem.go
+++ b/pkg/sentry/fsimpl/gofer/filesystem.go
@@ -887,23 +887,28 @@ func (fs *filesystem) MkdirAt(ctx context.Context, rp *vfs.ResolvingPath, opts v
} else {
_, err = parent.file.mkdir(ctx, name, p9.FileMode(mode), (p9.UID)(creds.EffectiveKUID), p9.GID(kgid))
}
- if err != nil {
- if !opts.ForSyntheticMountpoint || linuxerr.Equals(linuxerr.EEXIST, err) {
- return nil, err
+ if err == nil {
+ if fs.opts.interop != InteropModeShared {
+ parent.incLinks()
}
- ctx.Infof("Failed to create remote directory %q: %v; falling back to synthetic directory", name, err)
- parent.createSyntheticChildLocked(&createSyntheticOpts{
- name: name,
- mode: linux.S_IFDIR | opts.Mode,
- kuid: creds.EffectiveKUID,
- kgid: creds.EffectiveKGID,
- })
- *ds = appendDentry(*ds, parent)
+ return childDirInode, nil
}
+
+ if !opts.ForSyntheticMountpoint || linuxerr.Equals(linuxerr.EEXIST, err) {
+ return nil, err
+ }
+ ctx.Infof("Failed to create remote directory %q: %v; falling back to synthetic directory", name, err)
+ parent.createSyntheticChildLocked(&createSyntheticOpts{
+ name: name,
+ mode: linux.S_IFDIR | opts.Mode,
+ kuid: creds.EffectiveKUID,
+ kgid: creds.EffectiveKGID,
+ })
+ *ds = appendDentry(*ds, parent)
if fs.opts.interop != InteropModeShared {
parent.incLinks()
}
- return childDirInode, nil
+ return nil, nil
}, func(parent *dentry, name string) error {
if !opts.ForSyntheticMountpoint {
// Can't create non-synthetic files in synthetic directories.