diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-08-25 22:04:47 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-25 22:04:47 +0000 |
commit | 001f6a532c343df42ec8c708f7c34de265617e5d (patch) | |
tree | 6bc58216b18091927f982dabf07030c90c6d1028 /pkg/sentry/fsimpl/overlay | |
parent | 09136251e1edc9c035dd5c0f9d5589dcf5889cf5 (diff) | |
parent | c28bbee993daea0efe2cc4cce6fdb6cbcf93c470 (diff) |
Merge release-20200818.0-50-gc28bbee99 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/overlay')
-rw-r--r-- | pkg/sentry/fsimpl/overlay/overlay.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/overlay/overlay.go b/pkg/sentry/fsimpl/overlay/overlay.go index 4b3dfbc01..00562667f 100644 --- a/pkg/sentry/fsimpl/overlay/overlay.go +++ b/pkg/sentry/fsimpl/overlay/overlay.go @@ -315,7 +315,11 @@ func clonePrivateMount(vfsObj *vfs.VirtualFilesystem, vd vfs.VirtualDentry, forc if err != nil { return vfs.VirtualDentry{}, err } - return vfs.MakeVirtualDentry(newmnt, vd.Dentry()), nil + // Take a reference on the dentry which will be owned by the returned + // VirtualDentry. + d := vd.Dentry() + d.IncRef() + return vfs.MakeVirtualDentry(newmnt, d), nil } // Release implements vfs.FilesystemImpl.Release. |