syzbot


INFO: task hung in start_transaction

Status: upstream: reported C repro on 2022/12/23 07:52
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+edcc9d8008424faab3de@syzkaller.appspotmail.com
First crash: 538d, last: 488d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 INFO: task hung in start_transaction 1 74d 74d 0/3 upstream: reported on 2024/03/31 10:14

Sample crash report:
INFO: task kworker/u4:3:236 blocked for more than 140 seconds.
      Not tainted 4.19.211-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
kworker/u4:3    D25184   236      2 0x80000000
Workqueue: events_unbound btrfs_async_reclaim_metadata_space
Call Trace:
 context_switch kernel/sched/core.c:2828 [inline]
 __schedule+0x887/0x2040 kernel/sched/core.c:3517
 schedule+0x8d/0x1b0 kernel/sched/core.c:3561
 wait_current_trans+0x2e2/0x390 fs/btrfs/transaction.c:422
 start_transaction+0x699/0xf90 fs/btrfs/transaction.c:536
 flush_space+0x9af/0xee0 fs/btrfs/extent-tree.c:4839
 btrfs_async_reclaim_metadata_space+0x466/0x1050 fs/btrfs/extent-tree.c:4977
 process_one_work+0x864/0x1570 kernel/workqueue.c:2153
 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296
 kthread+0x33f/0x460 kernel/kthread.c:259
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
INFO: task btrfs-transacti:8142 blocked for more than 140 seconds.
      Not tainted 4.19.211-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
btrfs-transacti D27184  8142      2 0x80000000
Call Trace:
 context_switch kernel/sched/core.c:2828 [inline]
 __schedule+0x887/0x2040 kernel/sched/core.c:3517
 schedule+0x8d/0x1b0 kernel/sched/core.c:3561
 btrfs_tree_lock+0x4fe/0x810 fs/btrfs/locking.c:233
 btrfs_init_new_buffer fs/btrfs/extent-tree.c:8145 [inline]
 btrfs_alloc_tree_block+0x9b1/0x15f0 fs/btrfs/extent-tree.c:8284
 alloc_tree_block_no_bg_flush+0x1b6/0x250 fs/btrfs/ctree.c:1039
 __btrfs_cow_block+0x3c7/0x10a0 fs/btrfs/ctree.c:1094
 btrfs_cow_block+0x276/0x840 fs/btrfs/ctree.c:1557
 btrfs_search_slot+0x66a/0x1ee0 fs/btrfs/ctree.c:2881
 btrfs_update_root+0xc9/0x6b0 fs/btrfs/root-tree.c:134
 commit_fs_roots+0x3b5/0x530 fs/btrfs/transaction.c:1286
 btrfs_commit_transaction+0x8ca/0x2480 fs/btrfs/transaction.c:2178
 transaction_kthread+0x385/0x490 fs/btrfs/disk-io.c:1794
 kthread+0x33f/0x460 kernel/kthread.c:259
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

Showing all locks held in the system:
3 locks held by kworker/u4:3/236:
 #0: 0000000068530e04 ((wq_completion)"events_unbound"){+.+.}, at: process_one_work+0x767/0x1570 kernel/workqueue.c:2124
 #1: 00000000f28d9113 ((work_completion)(work)#2){+.+.}, at: process_one_work+0x79c/0x1570 kernel/workqueue.c:2128
 #2: 00000000d3b92991 (sb_internal#2){.+.+}, at: sb_start_intwrite include/linux/fs.h:1626 [inline]
 #2: 00000000d3b92991 (sb_internal#2){.+.+}, at: start_transaction+0xa37/0xf90 fs/btrfs/transaction.c:528
1 lock held by khungtaskd/1571:
 #0: 0000000075c5e21b (rcu_read_lock){....}, at: debug_show_all_locks+0x53/0x265 kernel/locking/lockdep.c:4441
3 locks held by btrfs-transacti/8142:
 #0: 0000000023e43385 (&fs_info->transaction_kthread_mutex){+.+.}, at: transaction_kthread+0xfa/0x490 fs/btrfs/disk-io.c:1765
 #1: 0000000035a27424 (&fs_info->reloc_mutex){+.+.}, at: btrfs_commit_transaction+0x80b/0x2480 fs/btrfs/transaction.c:2120
 #2: 000000000ba074f5 (&fs_info->tree_log_mutex){+.+.}, at: btrfs_commit_transaction+0x8c2/0x2480 fs/btrfs/transaction.c:2176
2 locks held by syz-executor173/9785:
 #0: 0000000067397c7b (sb_writers#12){.+.+}, at: sb_start_write include/linux/fs.h:1579 [inline]
 #0: 0000000067397c7b (sb_writers#12){.+.+}, at: mnt_want_write+0x3a/0xb0 fs/namespace.c:360
 #1: 00000000eb40410f (&type->i_mutex_dir_key#7){++++}, at: inode_lock include/linux/fs.h:748 [inline]
 #1: 00000000eb40410f (&type->i_mutex_dir_key#7){++++}, at: vfs_setxattr+0xc7/0x270 fs/xattr.c:254

=============================================

NMI backtrace for cpu 0
CPU: 0 PID: 1571 Comm: khungtaskd Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 nmi_cpu_backtrace.cold+0x63/0xa2 lib/nmi_backtrace.c:101
 nmi_trigger_cpumask_backtrace+0x1a6/0x1f0 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:203 [inline]
 watchdog+0x991/0xe60 kernel/hung_task.c:287
 kthread+0x33f/0x460 kernel/kthread.c:259
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 4682 Comm: systemd-journal Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:orc_find arch/x86/kernel/unwind_orc.c:150 [inline]
RIP: 0010:unwind_next_frame+0x285/0x1400 arch/x86/kernel/unwind_orc.c:422
Code: 48 89 54 24 30 48 89 74 24 28 44 89 5c 24 20 e8 71 de 6e 00 48 8b 54 24 30 48 8b 74 24 28 44 8b 5c 24 20 8b 0c 95 bc 91 17 8c <8d> 56 01 48 b8 00 00 00 00 00 fc ff df 48 8d 3c 95 bc 91 17 8c 49
RSP: 0018:ffff8880a15479a8 EFLAGS: 00000246
RAX: 0000000000000007 RBX: 1ffff110142a8f3e RCX: 0000000000022d60
RDX: 0000000000009854 RSI: 0000000000009854 RDI: ffffffff8c19f30c
RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000001
R10: ffff8880a1547b37 R11: 0000000000074071 R12: ffff8880a1547b20
R13: ffff8880a1547b0d R14: ffff8880a1547ad8 R15: ffffffff8198548a
FS:  00007fdff69d78c0(0000) GS:ffff8880ba100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fdff3db7000 CR3: 00000000a323c000 CR4: 00000000003406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __save_stack_trace+0xd6/0x190 arch/x86/kernel/stacktrace.c:44
 save_stack mm/kasan/kasan.c:448 [inline]
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:553
 kmem_cache_alloc+0x122/0x370 mm/slab.c:3559
 getname_flags+0xce/0x590 fs/namei.c:140
 user_path_at_empty+0x2a/0x50 fs/namei.c:2609
 user_path_at include/linux/namei.h:57 [inline]
 do_faccessat+0x248/0x7a0 fs/open.c:397
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fdff5c929c7
Code: 83 c4 08 48 3d 01 f0 ff ff 73 01 c3 48 8b 0d c8 d4 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 b8 15 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a1 d4 2b 00 f7 d8 64 89 01 48
RSP: 002b:00007ffd64aac6e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000015
RAX: ffffffffffffffda RBX: 00007ffd64aaf600 RCX: 00007fdff5c929c7
RDX: 00007fdff6703a00 RSI: 0000000000000000 RDI: 0000563f6695b9a3
RBP: 00007ffd64aac720 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000069 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007ffd64aaf600 R15: 00007ffd64aacc10

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/14 05:38 linux-4.19.y 3f8a27f9e27b 529798b0 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 INFO: task hung in start_transaction
2022/12/23 07:51 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 INFO: task hung in start_transaction
2023/02/11 21:01 linux-4.19.y 3f8a27f9e27b 93e26d60 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 INFO: task hung in start_transaction
* Struck through repros no longer work on HEAD.