[linus:master] [fs] 761475268f: BUG:KCSAN:data-race_in_atime_needs_update/touch_atime

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.gfs2,dev.linux.lists.oe-lkp,org.infradead.lists.linux-mtd,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-nfs,org.kernel.vger.linux-unionfs,org.kernel.vger.linux-xfs
Message-ID <[email protected]>

Hello,


it seems to us this change causes the stats changes for various (random)
KCSAN issues. just FYI what we observed in tests.

=========================================================================================
tbox_group/testcase/rootfs/kconfig/compiler/runtime/group/nr_groups:
  vm-snb/trinity/yocto-i386-minimal-20190520.cgz/x86_64-randconfig-013-20260223/gcc-14/300s/group-01/5

1cbc822816758b26 761475268fa8e322fe6b80bcf55
---------------- ---------------------------
       fail:runs  %reproduction    fail:runs
           |             |             |
          1:200          2%           4:200   dmesg.BUG:KCSAN:data-race_in_alloc_pid/copy_process
          1:200         -0%            :200   dmesg.BUG:KCSAN:data-race_in_atime_needs_update/inode_set_ctime_current
         32:200        -16%            :200   dmesg.BUG:KCSAN:data-race_in_atime_needs_update/inode_update_timestamps
           :200         17%          34:200   dmesg.BUG:KCSAN:data-race_in_atime_needs_update/touch_atime
          1:200          0%           1:200   dmesg.BUG:KCSAN:data-race_in_credit_init_bits/try_to_generate_entropy
          2:200         -1%            :200   dmesg.BUG:KCSAN:data-race_in_crng_reseed/try_to_generate_entropy
          1:200          1%           3:200   dmesg.BUG:KCSAN:data-race_in_file_update_time_flags/inode_set_ctime_current
          2:200         -1%            :200   dmesg.BUG:KCSAN:data-race_in_file_update_time_flags/inode_update_timestamps
          6:200         -3%            :200   dmesg.BUG:KCSAN:data-race_in_generic_fillattr/inode_update_timestamps
           :200          6%          11:200   dmesg.BUG:KCSAN:data-race_in_generic_fillattr/touch_atime
           :200          1%           2:200   dmesg.BUG:KCSAN:data-race_in_inode_set_ctime_current/inode_update_time
         22:200        -11%            :200   dmesg.BUG:KCSAN:data-race_in_inode_update_timestamps/inode_update_timestamps
           :200         10%          20:200   dmesg.BUG:KCSAN:data-race_in_touch_atime/touch_atime


kernel test robot noticed "BUG:KCSAN:data-race_in_atime_needs_update/touch_atime" on:

commit: 761475268fa8e322fe6b80bcf557dc65517df71e ("fs: refactor ->update_time handling")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master


in testcase: trinity
version: 
with following parameters:

	runtime: 300s
	group: group-01
	nr_groups: 5


config: x86_64-randconfig-013-20260223
compiler: gcc-14
test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 32G

(please refer to attached dmesg/kmsg for entire log/backtrace)


If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-lkp/[email protected]


[  180.177701][T23712] BUG: KCSAN: data-race in atime_needs_update / touch_atime
[  180.178300][T23712]
[  180.178556][T23712] write to 0xffff8881005bf140 of 4 bytes by task 23711 on cpu 0:
[  180.179221][T23712]  touch_atime (include/linux/fs.h:1624 fs/inode.c:2092 fs/inode.c:2135 fs/inode.c:2158 fs/inode.c:2236)
[  180.179620][T23712]  pick_link (fs/namei.c:1989)
[  180.180009][T23712]  step_into_slowpath (fs/namei.c:2066)
[  180.180442][T23712]  open_last_lookups (fs/namei.c:2091 fs/namei.c:4575)
[  180.180870][T23712]  path_openat (fs/namei.c:4784)
[  180.181260][T23712]  do_filp_open (fs/namei.c:4814)
[  180.181665][T23712]  do_open_execat (fs/exec.c:783)
[  180.184266][T23712]  open_exec (fs/exec.c:823)
[  180.184645][T23712]  load_elf_binary (include/linux/slab.h:957 fs/binfmt_elf.c:919)
[  180.185075][T23712]  exec_binprm (fs/exec.c:1671 fs/exec.c:1701)
[  180.185469][T23712]  bprm_execve (fs/exec.c:1735)
[  180.185898][T23712]  bprm_execve (fs/exec.c:1781)
[  180.186295][T23712]  kernel_execve (fs/exec.c:1919)
[  180.186707][T23712]  call_usermodehelper_exec_async (kernel/umh.c:113)
[  180.187226][T23712]  ret_from_fork (arch/x86/kernel/process.c:164)
[  180.187637][T23712]  ret_from_fork_asm (arch/x86/entry/entry_64.S:256)
[  180.188059][T23712]
[  180.188315][T23712] read to 0xffff8881005bf140 of 4 bytes by task 23712 on cpu 1:
[  180.188962][T23712]  atime_needs_update (fs/inode.c:2056 fs/inode.c:2201)
[  180.189403][T23712]  pick_link (fs/namei.c:1983 (discriminator 2))
[  180.189795][T23712]  step_into_slowpath (fs/namei.c:2066)
[  180.190229][T23712]  open_last_lookups (fs/namei.c:2091 fs/namei.c:4575)
[  180.190657][T23712]  path_openat (fs/namei.c:4784)
[  180.191075][T23712]  do_filp_open (fs/namei.c:4814)
[  180.191479][T23712]  do_open_execat (fs/exec.c:783)
[  180.191885][T23712]  open_exec (fs/exec.c:823)
[  180.192256][T23712]  load_elf_binary (include/linux/slab.h:957 fs/binfmt_elf.c:919)
[  180.192683][T23712]  exec_binprm (fs/exec.c:1671 fs/exec.c:1701)
[  180.193082][T23712]  bprm_execve (fs/exec.c:1735)
[  180.193537][T23712]  bprm_execve (fs/exec.c:1781)
[  180.193922][T23712]  kernel_execve (fs/exec.c:1919)
[  180.194333][T23712]  call_usermodehelper_exec_async (kernel/umh.c:113)
[  180.194850][T23712]  ret_from_fork (arch/x86/kernel/process.c:164)
[  180.195265][T23712]  ret_from_fork_asm (arch/x86/entry/entry_64.S:256)
[  180.195684][T23712]
[  180.195936][T23712] value changed: 0x2160ec00 -> 0x22921900
[  180.196415][T23712]
[  180.196667][T23712] Reported by Kernel Concurrency Sanitizer on:
[  180.197175][T23712] CPU: 1 UID: 0 PID: 23712 Comm: kworker/u8:0 Not tainted 6.19.0-rc1-00005-g761475268fa8 #1 PREEMPT  0fd055f61ee6c01889a41da1288262ad66e4a70f
[  180.198323][T23712] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[  180.199162][T23712] ==================================================================



The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20260226/[email protected]



-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.