syzbot


KCSAN: data-race in __btrfs_add_free_space / btrfs_wait_block_group_cache_progress

Status: auto-closed as invalid on 2021/03/28 23:22
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+8dc6eb2b2878291b2ef3@syzkaller.appspotmail.com
First crash: 1526d, last: 1368d

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __btrfs_add_free_space / btrfs_wait_block_group_cache_progress

write to 0xffff888027d09790 of 8 bytes by task 10755 on cpu 1:
 link_free_space fs/btrfs/free-space-cache.c:1727 [inline]
 __btrfs_add_free_space+0x3d1/0xdb0 fs/btrfs/free-space-cache.c:2501
 btrfs_add_free_space_async_trimmed+0x6c/0x80 fs/btrfs/free-space-cache.c:2548
 add_new_free_space+0x189/0x1e0 fs/btrfs/block-group.c:502
 load_extent_tree_free fs/btrfs/block-group.c:618 [inline]
 caching_thread+0x488/0x8d0 fs/btrfs/block-group.c:687
 btrfs_work_helper+0x1e2/0x380 fs/btrfs/async-thread.c:318
 process_one_work+0x3e1/0x950 kernel/workqueue.c:2275
 worker_thread+0x616/0xa70 kernel/workqueue.c:2421
 kthread+0x20b/0x230 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294

read to 0xffff888027d09790 of 8 bytes by task 8418 on cpu 0:
 btrfs_wait_block_group_cache_progress+0x185/0x2c0 fs/btrfs/block-group.c:405
 find_free_extent_unclustered fs/btrfs/extent-tree.c:3716 [inline]
 do_allocation_clustered fs/btrfs/extent-tree.c:3741 [inline]
 do_allocation fs/btrfs/extent-tree.c:3750 [inline]
 find_free_extent+0xe7a/0x1a30 fs/btrfs/extent-tree.c:4162
 btrfs_reserve_extent+0x118/0x2c0 fs/btrfs/extent-tree.c:4292
 btrfs_alloc_tree_block+0xfe/0x880 fs/btrfs/extent-tree.c:4693
 alloc_tree_block_no_bg_flush fs/btrfs/ctree.c:989 [inline]
 __btrfs_cow_block+0x2f2/0xac0 fs/btrfs/ctree.c:1045
 btrfs_cow_block+0x252/0x3a0 fs/btrfs/ctree.c:1490
 commit_cowonly_roots+0x94/0x5e0 fs/btrfs/transaction.c:1225
 btrfs_commit_transaction+0x95e/0x1870 fs/btrfs/transaction.c:2275
 btrfs_commit_super+0x8f/0xa0 fs/btrfs/disk-io.c:4077
 close_ctree+0x1af/0x4ad fs/btrfs/disk-io.c:4141
 btrfs_put_super+0x21/0x30 fs/btrfs/super.c:326
 generic_shutdown_super+0xde/0x210 fs/super.c:464
 kill_anon_super+0x23/0x40 fs/super.c:1055
 btrfs_kill_super+0x26/0x40 fs/btrfs/super.c:2347
 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:140
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:174 [inline]
 exit_to_user_mode_prepare+0x17c/0x1b0 kernel/entry/common.c:201
 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline]
 syscall_exit_to_user_mode+0x20/0x40 kernel/entry/common.c:294
 do_syscall_64+0x45/0x80 arch/x86/entry/common.c:56
 entry_SYSCALL_64_after_hwframe+0x44/0xae

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

Crashes (20):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/02/21 23:21 upstream 55f62bc87347 a659b3f1 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __btrfs_add_free_space / btrfs_wait_block_group_cache_progress
2021/02/17 22:04 upstream f40ddce88593 14052202 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __btrfs_add_free_space / btrfs_wait_block_group_cache_progress
2021/02/13 20:36 upstream c6d8570e4d64 98682e5e .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __btrfs_add_free_space / btrfs_wait_block_group_cache_progress
2021/02/12 11:47 upstream dcc0b49040c7 a5f86b15 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __btrfs_add_free_space / btrfs_wait_block_group_cache_progress
2021/02/01 20:10 upstream 88bb507a74ea e6b95f32 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __btrfs_add_free_space / btrfs_wait_block_group_cache_progress
2021/01/18 08:03 upstream 19c329f68089 fd103621 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __btrfs_add_free_space / btrfs_wait_block_group_cache_progress
2021/01/17 15:04 upstream 0da0a8a0a0e1 fd103621 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __btrfs_add_free_space / btrfs_wait_block_group_cache_progress
2020/12/24 03:35 upstream 58cf05f597b0 c2c1d1dd .config console log report info ci2-upstream-kcsan-gce
2020/12/10 05:22 upstream ca4bbdaf1716 c090b4da .config console log report info ci2-upstream-kcsan-gce
2020/12/06 17:29 upstream 7059c2c00a21 f12ba0c5 .config console log report info ci2-upstream-kcsan-gce
2020/11/28 14:16 upstream c84e1efae022 3c7136c0 .config console log report info ci2-upstream-kcsan-gce
2020/11/26 00:02 upstream fa02fcd94b0c 3f581b43 .config console log report info ci2-upstream-kcsan-gce
2020/11/12 11:46 upstream 3d5e28bff7ad 77a55c8e .config console log report info ci2-upstream-kcsan-gce
2020/11/03 07:51 upstream 495023e4e49e 7f344fa6 .config console log report info ci2-upstream-kcsan-gce
2020/10/31 23:30 upstream 5fc6b075e165 8bc4594f .config console log report info ci2-upstream-kcsan-gce
2020/10/29 03:27 upstream ed8780e3f2ec f24824d3 .config console log report info ci2-upstream-kcsan-gce
2020/10/22 14:32 upstream f804b3159482 be6b1582 .config console log report info ci2-upstream-kcsan-gce
2020/09/23 17:44 upstream 805c6d3c1921 287cd75a .config console log report info ci2-upstream-kcsan-gce
2020/09/22 11:49 upstream 98477740630f 3e8f6c27 .config console log report info ci2-upstream-kcsan-gce
2020/09/17 01:11 upstream 5925fa68fe82 77507d02 .config console log report info ci2-upstream-kcsan-gce
* Struck through repros no longer work on HEAD.