diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-11-19 02:13:19 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-11-19 02:13:19 +0000 |
commit | 2406166204cb3875b79b863e767c1b1bb22cc70a (patch) | |
tree | bb0a909079a1cb8a53a066d998fc2b83187ec37d /pkg/sentry/fsimpl/tmpfs/filesystem.go | |
parent | 39603900af85c3d75112238d02bbc7da23d3930f (diff) | |
parent | 3a16b829c511757701d4370b8b38d162acb8ba9c (diff) |
Merge release-20201109.0-81-g3a16b829c (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/tmpfs/filesystem.go')
-rw-r--r-- | pkg/sentry/fsimpl/tmpfs/filesystem.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/tmpfs/filesystem.go b/pkg/sentry/fsimpl/tmpfs/filesystem.go index 61138a7a4..9296db2fb 100644 --- a/pkg/sentry/fsimpl/tmpfs/filesystem.go +++ b/pkg/sentry/fsimpl/tmpfs/filesystem.go @@ -21,6 +21,7 @@ import ( "gvisor.dev/gvisor/pkg/abi/linux" "gvisor.dev/gvisor/pkg/context" "gvisor.dev/gvisor/pkg/fspath" + "gvisor.dev/gvisor/pkg/sentry/fsmetric" "gvisor.dev/gvisor/pkg/sentry/kernel/auth" "gvisor.dev/gvisor/pkg/sentry/socket/unix/transport" "gvisor.dev/gvisor/pkg/sentry/vfs" @@ -439,6 +440,11 @@ func (d *dentry) open(ctx context.Context, rp *vfs.ResolvingPath, opts *vfs.Open return nil, err } } + if fd.vfsfd.IsWritable() { + fsmetric.TmpfsOpensW.Increment() + } else if fd.vfsfd.IsReadable() { + fsmetric.TmpfsOpensRO.Increment() + } return &fd.vfsfd, nil case *directory: // Can't open directories writably. |