diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-10-27 00:04:06 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-10-27 00:04:06 +0000 |
commit | 4a42e7524518af56e34a922ddc717e963594f9a3 (patch) | |
tree | 3eeeb3418cae706f2d0989ecf5e09634f0781c74 /pkg/sentry/vfs/mount.go | |
parent | 1295a9562a49567c519b5115afd836297a0a73f0 (diff) | |
parent | 7b8f19dc76a9fecbf4d2e5f43a47c6d47d53e100 (diff) |
Merge release-20211019.0-44-g7b8f19dc7 (automated)
Diffstat (limited to 'pkg/sentry/vfs/mount.go')
-rw-r--r-- | pkg/sentry/vfs/mount.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pkg/sentry/vfs/mount.go b/pkg/sentry/vfs/mount.go index 05a416775..9ab9a8fca 100644 --- a/pkg/sentry/vfs/mount.go +++ b/pkg/sentry/vfs/mount.go @@ -178,12 +178,12 @@ func (vfs *VirtualFilesystem) NewMountNamespace(ctx context.Context, creds *auth // (which may be nil). The new Mount is not associated with any MountNamespace // and is not connected to any other Mounts. References are taken on fs and // root. -func (vfs *VirtualFilesystem) NewDisconnectedMount(fs *Filesystem, root *Dentry, opts *MountOptions) (*Mount, error) { +func (vfs *VirtualFilesystem) NewDisconnectedMount(fs *Filesystem, root *Dentry, opts *MountOptions) *Mount { fs.IncRef() if root != nil { root.IncRef() } - return newMount(vfs, fs, root, nil /* mntns */, opts), nil + return newMount(vfs, fs, root, nil /* mntns */, opts) } // MountDisconnected creates a Filesystem configured by the given arguments, @@ -201,9 +201,7 @@ func (vfs *VirtualFilesystem) MountDisconnected(ctx context.Context, creds *auth if err != nil { return nil, err } - defer root.DecRef(ctx) - defer fs.DecRef(ctx) - return vfs.NewDisconnectedMount(fs, root, opts) + return newMount(vfs, fs, root, nil /* mntns */, opts), nil } // ConnectMountAt connects mnt at the path represented by target. |