From cc1b20590cf4505e04b8c221d1d950e45110f5f0 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Fri, 13 Nov 2020 00:46:16 -0800 Subject: fs/tmpfs: use atomic operations to access inode.mode PiperOrigin-RevId: 342214859 --- pkg/sentry/fsimpl/tmpfs/tmpfs.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/sentry') diff --git a/pkg/sentry/fsimpl/tmpfs/tmpfs.go b/pkg/sentry/fsimpl/tmpfs/tmpfs.go index c5a131d5d..0c9c639d3 100644 --- a/pkg/sentry/fsimpl/tmpfs/tmpfs.go +++ b/pkg/sentry/fsimpl/tmpfs/tmpfs.go @@ -631,7 +631,8 @@ func (i *inode) direntType() uint8 { } func (i *inode) isDir() bool { - return linux.FileMode(i.mode).FileType() == linux.S_IFDIR + mode := linux.FileMode(atomic.LoadUint32(&i.mode)) + return mode.FileType() == linux.S_IFDIR } func (i *inode) touchAtime(mnt *vfs.Mount) { -- cgit v1.2.3