jbd2_seq_info_show() reads journal->j_average_commit_time directly from /proc/fs/jbd2//info, while the commit thread updates the same u64 under write_lock(&journal->j_state_lock). The field is documented as protected by j_state_lock, and the existing reader in jbd2_journal_stop() already takes read_lock() for it. The procfs path takes neither j_state_lock nor READ_ONCE()/data_race(), so KCSAN reports a data race; on 32-bit builds the unlocked 64-bit read can also tear. The detailed description: * Test environment / affected version Linux version 7.3.0 (gcc 13.3.0, GNU ld 2.42) #1 SMP PREEMPT_DYNAMIC, vanilla mainline 7.3, rebuilt with CONFIG_KCSAN=y, CONFIG_EXT4_FS=y, CONFIG_JBD2=y, CONFIG_PROC_FS=y. QEMU/KVM x86_64 guest, 8 vCPU, 4 GB RAM. The ext4 test image is 256 MB with an 8 MB journal and is mounted with commit=1. Line numbers below are from 7.3. * Mechanism Reader (procfs show path, process context): fs/jbd2/journal.c:1149-1150 seq_printf(seq, " %lluus average transaction commit time\n", div_u64(s->journal->j_average_commit_time, 1000)); This is a plain load of a u64 with no j_state_lock and no READ_ONCE()/data_race(). jbd2_seq_info_open() snapshots journal->j_stats under j_history_lock at journal.c:1186-1189, but the average commit time is deliberately read live from s->journal and is not part of that snapshot. Writer (kjournald2 commit thread): fs/jbd2/commit.c:1077 write_lock(&journal->j_state_lock); fs/jbd2/commit.c:1138-1142 if (likely(journal->j_average_commit_time)) journal->j_average_commit_time = (commit_time + journal->j_average_commit_time * 3) / 4; else journal->j_average_commit_time = commit_time; fs/jbd2/commit.c:1144 write_unlock(&journal->j_state_lock); The field annotation is explicit: include/linux/jbd2.h:1174-1179 /** * @j_average_commit_time: * * The average amount of time in nanoseconds it takes to commit a * transaction to disk. [j_state_lock] */ u64 j_average_commit_time; The same field is already read correctly elsewhere: fs/jbd2/transaction.c:1961-1963 read_lock(&journal->j_state_lock); commit_time = journal->j_average_commit_time; read_unlock(&journal->j_state_lock); There is no common lock between the procfs show path and the commit thread. seq_read_iter() holds m->lock, but the commit thread never takes it. * Trigger model and reproducer The reproducer is jbd2_race.c, a userspace program run inside a minimal initramfs. In mode "mr01" it starts 4 threads that repeatedly open and read /proc/fs/jbd2/vda-8/info, and 8 threads that write 4096 bytes to /mnt/jbd2- followed by fsync(). An 800 ms writer warmup ensures j_stats.ts_tid != 0, so the show path reaches the j_average_commit_time read. Workload duration is 35 s. * Observed result on 7.3 The first report is at 10.651 s: BUG: KCSAN: data-race in jbd2_journal_commit_transaction / jbd2_seq_info_show read to 0xff2c44c8c0b02cb0 of 8 bytes by task 124 on cpu 1: jbd2_seq_info_show+0x29c/0x3b0 seq_read_iter+0x237/0x6f0 seq_read+0x1ad/0x1f0 proc_reg_read+0xae/0x150 read-write to 0xff2c44c8c0b02cb0 of 8 bytes by task 114 on cpu 2: jbd2_journal_commit_transaction+0x217f/0x2850 kjournald2+0xfb/0x310 The 8-byte width matches u64 j_average_commit_time. The control run plan-mr01ctl.log produced 0 target reports (17 unrelated KCSAN reports from VFS/clocksource code were filtered out). * Suggested direction Take a local snapshot under the existing read lock, then print it: u64 avg; read_lock(&journal->j_state_lock); avg = journal->j_average_commit_time; read_unlock(&journal->j_state_lock); seq_printf(seq, " %lluus average transaction commit time\n", div_u64(avg, 1000)); A READ_ONCE() would silence KCSAN but would not give the reader a consistent 64-bit value on 32-bit builds; the read lock is the stronger and already established protocol for this field. Please keep me in Cc; I am not subscribed to the lists. Regards, Hanxiang Xu xuhx@hust.edu.cn