syzbot


KCSAN: data-race in ext4_has_free_clusters / percpu_counter_add_batch

Status: closed as invalid on 2019/10/18 14:11
Subsystems: ext4
[Documentation on labels]
First crash: 1936d, last: 1931d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in ext4_has_free_clusters / percpu_counter_add_batch (2) ext4 208 1750d 1880d 0/28 auto-closed as invalid on 2020/06/18 13:11

Sample crash report:
==================================================================
BUG: KCSAN: data-race in ext4_has_free_clusters / percpu_counter_add_batch

write to 0xffff8881264278e0 of 8 bytes by task 7965 on cpu 1:
 percpu_counter_add_batch+0xca/0x150 lib/percpu_counter.c:91
 percpu_counter_add include/linux/percpu_counter.h:55 [inline]
 percpu_counter_sub include/linux/percpu_counter.h:189 [inline]
 ext4_mb_mark_diskspace_used+0x525/0x9d0 fs/ext4/mballoc.c:3010
 ext4_mb_new_blocks+0x6fc/0x1de0 fs/ext4/mballoc.c:4556
 ext4_ext_map_blocks+0x1c1e/0x2330 fs/ext4/extents.c:4460
 ext4_map_blocks+0x23a/0xfa0 fs/ext4/inode.c:640
 mpage_map_one_extent fs/ext4/inode.c:2468 [inline]
 mpage_map_and_submit_extent fs/ext4/inode.c:2517 [inline]
 ext4_writepages+0x136e/0x2300 fs/ext4/inode.c:2869
 do_writepages+0x6b/0x170 mm/page-writeback.c:2344
 __filemap_fdatawrite_range+0x1c5/0x230 mm/filemap.c:420
 file_write_and_wait_range+0xfd/0x160 mm/filemap.c:781
 __generic_file_fsync+0x59/0x190 fs/libfs.c:1000
 ext4_sync_file+0x48e/0xb00 fs/ext4/fsync.c:120
 vfs_fsync_range+0x82/0x150 fs/sync.c:197
 generic_write_sync include/linux/fs.h:2853 [inline]
 ext4_file_write_iter+0x45b/0xa00 fs/ext4/file.c:279
 call_write_iter include/linux/fs.h:1895 [inline]
 do_iter_readv_writev+0x487/0x5b0 fs/read_write.c:693

read to 0xffff8881264278e0 of 8 bytes by task 7967 on cpu 0:
 ext4_has_free_clusters+0x44/0x320 fs/ext4/balloc.c:554
 ext4_claim_free_clusters+0x2e/0x90 fs/ext4/balloc.c:598
 ext4_da_reserve_space+0x102/0x280 fs/ext4/inode.c:1612
 ext4_insert_delayed_block fs/ext4/inode.c:1780 [inline]
 ext4_da_map_blocks fs/ext4/inode.c:1895 [inline]
 ext4_da_get_block_prep+0x87f/0xa60 fs/ext4/inode.c:1959
 ext4_block_write_begin+0x33e/0xba0 fs/ext4/inode.c:1202
 ext4_da_write_begin+0x1da/0x7e0 fs/ext4/inode.c:3094
 generic_perform_write+0x136/0x320 mm/filemap.c:3304
 __generic_file_write_iter+0x251/0x380 mm/filemap.c:3433
 ext4_file_write_iter+0x1bd/0xa00 fs/ext4/file.c:268
 call_write_iter include/linux/fs.h:1895 [inline]
 do_iter_readv_writev+0x487/0x5b0 fs/read_write.c:693
 do_iter_write fs/read_write.c:970 [inline]
 do_iter_write+0x13b/0x3c0 fs/read_write.c:951
 vfs_iter_write+0x5c/0x80 fs/read_write.c:983
 iter_file_splice_write+0x4c0/0x7f0 fs/splice.c:746

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 7967 Comm: syz-executor.5 Not tainted 5.4.0-rc3+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/10/16 13:00 https://github.com/google/ktsan.git kcsan a6311db074d9 d4ea592f .config console log report ci2-upstream-kcsan-gce
2019/10/14 10:18 https://github.com/google/ktsan.git kcsan d724f94f63de a6aef847 .config console log report ci2-upstream-kcsan-gce
2019/10/11 18:56 https://github.com/google/ktsan.git kcsan d724f94f63de 426631dd .config console log report ci2-upstream-kcsan-gce
2019/10/11 03:20 https://github.com/google/ktsan.git kcsan d724f94f63de 1a3bad90 .config console log report ci2-upstream-kcsan-gce
* Struck through repros no longer work on HEAD.