fs/tmpfs: use atomic operations to access inode.mode

PiperOrigin-RevId: 342214859
This commit is contained in:
Andrei Vagin
2020-11-13 00:48:22 -08:00
committed by gVisor bot
parent 8e6963491c
commit cc1b20590c
+2 -1
View File
@@ -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) {