================================================================== BUG: KCSAN: data-race in __btrfs_add_free_space / btrfs_wait_block_group_cache_progress write to 0xffff88811f11a790 of 8 bytes by task 25 on cpu 0: link_free_space fs/btrfs/free-space-cache.c:1673 [inline] __btrfs_add_free_space+0x3cd/0xd00 fs/btrfs/free-space-cache.c:2510 btrfs_add_free_space_async_trimmed+0x6c/0x80 fs/btrfs/free-space-cache.c:2557 add_new_free_space+0x189/0x1e0 fs/btrfs/block-group.c:485 load_extent_tree_free fs/btrfs/block-group.c:601 [inline] caching_thread+0x396/0x7e0 fs/btrfs/block-group.c:645 btrfs_work_helper+0x1e2/0x3c0 fs/btrfs/async-thread.c:318 process_one_work+0x3e1/0x9a0 kernel/workqueue.c:2269 worker_thread+0x665/0xbe0 kernel/workqueue.c:2415 kthread+0x20d/0x230 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 read to 0xffff88811f11a790 of 8 bytes by task 8713 on cpu 1: btrfs_wait_block_group_cache_progress+0x185/0x2b0 fs/btrfs/block-group.c:405 find_free_extent_clustered+0x5b7/0x790 fs/btrfs/extent-tree.c:3564 do_allocation_clustered fs/btrfs/extent-tree.c:3650 [inline] do_allocation fs/btrfs/extent-tree.c:3665 [inline] find_free_extent+0xd37/0x1a70 fs/btrfs/extent-tree.c:4076 btrfs_reserve_extent+0x118/0x2c0 fs/btrfs/extent-tree.c:4206 btrfs_alloc_tree_block+0x101/0x800 fs/btrfs/extent-tree.c:4603 alloc_tree_block_no_bg_flush fs/btrfs/ctree.c:987 [inline] __btrfs_cow_block+0x2d3/0x9e0 fs/btrfs/ctree.c:1042 btrfs_cow_block+0x261/0x3d0 fs/btrfs/ctree.c:1487 commit_cowonly_roots+0x8f/0x5a0 fs/btrfs/transaction.c:1184 btrfs_commit_transaction+0xa3c/0x18e0 fs/btrfs/transaction.c:2272 btrfs_sync_fs+0x14b/0x240 fs/btrfs/super.c:1383 __sync_filesystem fs/sync.c:39 [inline] sync_filesystem+0x112/0x160 fs/sync.c:67 generic_shutdown_super+0x42/0x210 fs/super.c:448 kill_anon_super+0x23/0x40 fs/super.c:1108 btrfs_kill_super+0x26/0x40 fs/btrfs/super.c:2265 deactivate_locked_super+0x6a/0xb0 fs/super.c:335 deactivate_super+0x85/0x90 fs/super.c:366 cleanup_mnt+0x277/0x2e0 fs/namespace.c:1118 __cleanup_mnt+0x15/0x20 fs/namespace.c:1125 task_work_run+0x8e/0x110 kernel/task_work.c:141 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:163 [inline] exit_to_user_mode_prepare+0x1b2/0x210 kernel/entry/common.c:190 syscall_exit_to_user_mode+0x16/0x30 kernel/entry/common.c:265 do_syscall_64+0x45/0x80 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 8713 Comm: syz-executor.3 Not tainted 5.9.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ==================================================================