================================================================== BUG: KCSAN: data-race in xas_find_marked / xas_init_marks read-write to 0xffff888108291d98 of 8 bytes by task 9551 on cpu 0: instrument_read_write include/linux/instrumented.h:55 [inline] __instrument_read_write_bitop include/asm-generic/bitops/instrumented-non-atomic.h:84 [inline] ___test_and_clear_bit include/asm-generic/bitops/instrumented-non-atomic.h:114 [inline] node_clear_mark lib/xarray.c:102 [inline] xas_clear_mark lib/xarray.c:914 [inline] xas_init_marks+0x17e/0x320 lib/xarray.c:947 xas_store+0x216/0xc90 lib/xarray.c:809 page_cache_delete mm/filemap.c:139 [inline] __filemap_remove_folio+0x1a8/0x2d0 mm/filemap.c:222 filemap_remove_folio+0x6c/0x1e0 mm/filemap.c:254 truncate_inode_folio mm/truncate.c:195 [inline] truncate_inode_pages_range+0x582/0x6a0 mm/truncate.c:424 truncate_inode_pages mm/truncate.c:448 [inline] truncate_pagecache+0x53/0x70 mm/truncate.c:741 ext4_setattr+0xa03/0xea0 fs/ext4/inode.c:5471 notify_change+0x866/0x8e0 fs/attr.c:499 do_truncate+0x116/0x150 fs/open.c:66 do_sys_ftruncate+0x2ba/0x3b0 fs/open.c:194 __do_sys_ftruncate fs/open.c:205 [inline] __se_sys_ftruncate fs/open.c:203 [inline] __x64_sys_ftruncate+0x33/0x40 fs/open.c:203 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b read to 0xffff888108291d98 of 8 bytes by task 8770 on cpu 1: xas_find_chunk include/linux/xarray.h:1723 [inline] xas_find_marked+0x216/0x660 lib/xarray.c:1354 find_get_entry+0x5d/0x290 mm/filemap.c:1960 filemap_get_folios_tag+0x136/0x210 mm/filemap.c:2210 mpage_prepare_extent_to_map+0x321/0xb70 fs/ext4/inode.c:2398 ext4_do_writepages+0x6ea/0x2100 fs/ext4/inode.c:2638 ext4_writepages+0x15e/0x2e0 fs/ext4/inode.c:2774 do_writepages+0x1c2/0x340 mm/page-writeback.c:2553 __writeback_single_inode+0x91/0x860 fs/fs-writeback.c:1625 writeback_sb_inodes+0x514/0xad0 fs/fs-writeback.c:1916 wb_writeback+0x252/0x6e0 fs/fs-writeback.c:2092 wb_do_writeback fs/fs-writeback.c:2239 [inline] wb_workfn+0x1a8/0x8d0 fs/fs-writeback.c:2279 process_one_work kernel/workqueue.c:2627 [inline] process_scheduled_works+0x5b8/0xa30 kernel/workqueue.c:2700 worker_thread+0x525/0x730 kernel/workqueue.c:2781 kthread+0x1d7/0x210 kernel/kthread.c:388 ret_from_fork+0x48/0x60 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 value changed: 0x0003ffff00000000 -> 0x0003fc0000000000 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 8770 Comm: kworker/u4:1 Not tainted 6.7.0-rc7-syzkaller-00003-gfbafc3e621c3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Workqueue: writeback wb_workfn (flush-7:0) ================================================================== EXT4-fs error (device loop5): ext4_mb_generate_buddy:1217: group 0, block bitmap and bg descriptor inconsistent: 25 vs 150994969 free clusters EXT4-fs (loop5): Delayed block allocation failed for inode 18 at logical offset 0 with max blocks 720 with error 28 EXT4-fs (loop5): This should not happen!! Data will be lost EXT4-fs (loop5): Total free blocks count 0 EXT4-fs (loop5): Free/Dirty block details EXT4-fs (loop5): free_blocks=2415919104 EXT4-fs (loop5): dirty_blocks=928 EXT4-fs (loop5): Block reservation details EXT4-fs (loop5): i_reserved_data_blocks=67 EXT4-fs error (device loop0): ext4_mb_generate_buddy:1217: group 0, block bitmap and bg descriptor inconsistent: 25 vs 150994969 free clusters EXT4-fs (loop0): Delayed block allocation failed for inode 18 at logical offset 0 with max blocks 2048 with error 28 EXT4-fs (loop0): This should not happen!! Data will be lost EXT4-fs (loop0): Total free blocks count 0 EXT4-fs (loop0): Free/Dirty block details EXT4-fs (loop0): free_blocks=2415919104 EXT4-fs (loop0): dirty_blocks=4208 EXT4-fs (loop0): Block reservation details EXT4-fs (loop0): i_reserved_data_blocks=263 EXT4-fs error (device loop0): ext4_mb_generate_buddy:1217: group 0, block bitmap and bg descriptor inconsistent: 25 vs 150994969 free clusters EXT4-fs (loop0): Delayed block allocation failed for inode 18 at logical offset 0 with max blocks 1752 with error 28 EXT4-fs (loop0): This should not happen!! Data will be lost EXT4-fs (loop0): Total free blocks count 0 EXT4-fs (loop0): Free/Dirty block details EXT4-fs (loop0): free_blocks=2415919104 EXT4-fs (loop0): dirty_blocks=1792 EXT4-fs (loop0): Block reservation details EXT4-fs (loop0): i_reserved_data_blocks=112