diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-04-21 19:20:51 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-21 19:20:51 +0000 |
commit | b5cdbb659d6ecd5a38090093369c81db76e8a152 (patch) | |
tree | 533d1ae7bafb1e27b601b62cc24b2cfc99ee6a5a /pkg/sentry/vfs/mount.go | |
parent | 3477221b21c89c56d64b039324513cda51b3f50a (diff) | |
parent | 9b5e305e05ef3ad51778981062d6152cea1cd4fb (diff) |
Merge release-20200323.0-203-g9b5e305 (automated)
Diffstat (limited to 'pkg/sentry/vfs/mount.go')
-rwxr-xr-x | pkg/sentry/vfs/mount.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg/sentry/vfs/mount.go b/pkg/sentry/vfs/mount.go index f06946103..02850b65c 100755 --- a/pkg/sentry/vfs/mount.go +++ b/pkg/sentry/vfs/mount.go @@ -188,6 +188,7 @@ func (vfs *VirtualFilesystem) MountAt(ctx context.Context, creds *auth.Credentia if err != nil { return err } + // We can't hold vfs.mountMu while calling FilesystemImpl methods due to // lock ordering. vd, err := vfs.GetDentryAt(ctx, creds, target, &GetDentryOptions{}) @@ -199,7 +200,7 @@ func (vfs *VirtualFilesystem) MountAt(ctx context.Context, creds *auth.Credentia vfs.mountMu.Lock() vd.dentry.mu.Lock() for { - if vd.dentry.IsDisowned() { + if vd.dentry.dead { vd.dentry.mu.Unlock() vfs.mountMu.Unlock() vd.DecRef() @@ -665,6 +666,12 @@ func (mnt *Mount) submountsLocked() []*Mount { return mounts } +// Root returns the mount's root. It does not take a reference on the returned +// Dentry. +func (mnt *Mount) Root() *Dentry { + return mnt.root +} + // Root returns mntns' root. A reference is taken on the returned // VirtualDentry. func (mntns *MountNamespace) Root() VirtualDentry { |