diff options
author | Nicolas Lacasse <nlacasse@google.com> | 2018-06-25 16:16:23 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-25 16:17:12 -0700 |
commit | 1a9917d14d66250fdc9a3781ef65df4413340a2f (patch) | |
tree | 6b732372d89723f27b4fbe547f6eddc8b5680e57 /pkg/sentry/fs/proc/mounts.go | |
parent | 478f0ac0038afda267814fa154bcd32feb07c3b3 (diff) |
MountSource.Root() should return a refernce on the dirent.
PiperOrigin-RevId: 202038397
Change-Id: I074d525f2e2d9bcd43b247b62f86f9129c101b78
Diffstat (limited to 'pkg/sentry/fs/proc/mounts.go')
-rw-r--r-- | pkg/sentry/fs/proc/mounts.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/sentry/fs/proc/mounts.go b/pkg/sentry/fs/proc/mounts.go index 76092567d..3d276dfa5 100644 --- a/pkg/sentry/fs/proc/mounts.go +++ b/pkg/sentry/fs/proc/mounts.go @@ -44,7 +44,9 @@ func forEachMountSource(t *kernel.Task, fn func(string, *fs.MountSource)) { return ms[i].ID() < ms[j].ID() }) for _, m := range ms { - mountPath, desc := m.Root().FullName(rootDir) + mroot := m.Root() + mountPath, desc := mroot.FullName(rootDir) + mroot.DecRef() if !desc { // MountSources that are not descendants of the chroot jail are ignored. continue @@ -88,7 +90,9 @@ func (mif *mountInfoFile) ReadSeqFileData(handle seqfile.SeqHandle) ([]seqfile.S // (3) Major:Minor device ID. We don't have a superblock, so we // just use the root inode device number. - sa := m.Root().Inode.StableAttr + mroot := m.Root() + sa := mroot.Inode.StableAttr + mroot.DecRef() fmt.Fprintf(&buf, "%d:%d ", sa.DeviceFileMajor, sa.DeviceFileMinor) // (4) Root: the pathname of the directory in the filesystem |