syzbot


INFO: task hung in btree_write_buffer_flush_seq

Status: upstream: reported C repro on 2024/11/10 08:33
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+cf3d1015b55ff73dcdc8@syzkaller.appspotmail.com
First crash: 192d, last: 41d
Cause bisection: introduced by (bisect log) :
commit 49fd90b2cc332b8607a616d99d4bb792f18208b9
Author: Kent Overstreet <kent.overstreet@linux.dev>
Date: Wed Sep 25 22:17:31 2024 +0000

  bcachefs: Fix unlocked access to c->disk_sb.sb in bch2_replicas_entry_validate()

Crash: INFO: task hung in bch2_replicas_entry_validate (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] INFO: task hung in btree_write_buffer_flush_seq 0 (1) 2024/11/10 08:33
Last patch testing requests (4)
Created Duration User Patch Repo Result
2025/02/28 21:47 22m retest repro upstream OK log
2025/02/28 11:36 28m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci OK log
2025/02/28 11:36 25m retest repro linux-next error
2024/11/20 10:08 26m retest repro upstream OK log

Sample crash report:
INFO: task bch-reclaim/loo:5856 blocked for more than 143 seconds.
      Not tainted 6.13.0-rc1-next-20241205-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:bch-reclaim/loo state:D stack:25144 pid:5856  tgid:5856  ppid:2      flags:0x00004000
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5371 [inline]
 __schedule+0x189f/0x4c80 kernel/sched/core.c:6758
 __schedule_loop kernel/sched/core.c:6835 [inline]
 schedule+0x14b/0x320 kernel/sched/core.c:6850
 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6907
 __mutex_lock_common kernel/locking/mutex.c:665 [inline]
 __mutex_lock+0x7e7/0xee0 kernel/locking/mutex.c:735
 btree_write_buffer_flush_seq+0x1c3f/0x1e10 fs/bcachefs/btree_write_buffer.c:548
 bch2_btree_write_buffer_journal_flush+0xc7/0x150 fs/bcachefs/btree_write_buffer.c:565
 journal_flush_pins+0x5f7/0xb20 fs/bcachefs/journal_reclaim.c:573
 __bch2_journal_reclaim+0x789/0xda0 fs/bcachefs/journal_reclaim.c:706
 bch2_journal_reclaim_thread+0x17a/0x570 fs/bcachefs/journal_reclaim.c:748
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/30:
 #0: ffffffff8e9374a0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #0: ffffffff8e9374a0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
 #0: ffffffff8e9374a0 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x55/0x2a0 kernel/locking/lockdep.c:6744
1 lock held by klogd/5193:
 #0: ffff8880b863e998 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:598
2 locks held by getty/5584:
 #0: ffff888034df20a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
 #1: ffffc90002fde2f0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x6a6/0x1e00 drivers/tty/n_tty.c:2211
5 locks held by syz-executor501/5845:
 #0: ffff888011cf40e0 (&type->s_umount_key#42){+.+.}-{4:4}, at: __super_lock fs/super.c:56 [inline]
 #0: ffff888011cf40e0 (&type->s_umount_key#42){+.+.}-{4:4}, at: __super_lock_excl fs/super.c:71 [inline]
 #0: ffff888011cf40e0 (&type->s_umount_key#42){+.+.}-{4:4}, at: deactivate_super+0xb5/0xf0 fs/super.c:505
 #1: ffff888074280278 (&c->state_lock){+.+.}-{4:4}, at: __bch2_fs_stop+0xfd/0x5c0 fs/bcachefs/super.c:622
 #2: ffff888074284378 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:158 [inline]
 #2: ffff888074284378 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:249 [inline]
 #2: ffff888074284378 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7e4/0xd30 fs/bcachefs/btree_iter.c:3354
 #3: ffff888074284720 (&wb->flushing.lock){+.+.}-{4:4}, at: btree_write_buffer_flush_seq+0x1c3f/0x1e10 fs/bcachefs/btree_write_buffer.c:548
 #4: ffff8880742a66d0 (&c->gc_lock){.+.+}-{4:4}, at: bch2_btree_update_start+0x682/0x14e0 fs/bcachefs/btree_update_interior.c:1191
3 locks held by bch-reclaim/loo/5856:
 #0: ffff8880742cb028 (&j->reclaim_lock){+.+.}-{4:4}, at: bch2_journal_reclaim_thread+0x16d/0x570 fs/bcachefs/journal_reclaim.c:747
 #1: ffff888074284378 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:158 [inline]
 #1: ffff888074284378 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:249 [inline]
 #1: ffff888074284378 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7e4/0xd30 fs/bcachefs/btree_iter.c:3354
 #2: ffff888074284720 (&wb->flushing.lock){+.+.}-{4:4}, at: btree_write_buffer_flush_seq+0x1c3f/0x1e10 fs/bcachefs/btree_write_buffer.c:548

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

NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 30 Comm: khungtaskd Not tainted 6.13.0-rc1-next-20241205-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 nmi_cpu_backtrace+0x49c/0x4d0 lib/nmi_backtrace.c:113
 nmi_trigger_cpumask_backtrace+0x198/0x320 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:162 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:234 [inline]
 watchdog+0xff6/0x1040 kernel/hung_task.c:397
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 52 Comm: kworker/u8:3 Not tainted 6.13.0-rc1-next-20241205-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: events_unbound toggle_allocation_gate
RIP: 0010:arch_static_branch arch/x86/include/asm/jump_label.h:36 [inline]
RIP: 0010:native_write_msr arch/x86/include/asm/msr.h:149 [inline]
RIP: 0010:wrmsrl arch/x86/include/asm/msr.h:264 [inline]
RIP: 0010:native_x2apic_icr_write arch/x86/include/asm/apic.h:233 [inline]
RIP: 0010:__x2apic_send_IPI_dest arch/x86/kernel/apic/x2apic_phys.c:113 [inline]
RIP: 0010:x2apic_send_IPI+0x7a/0xe0 arch/x86/kernel/apic/x2apic_phys.c:50
Code: d8 48 c1 e8 03 42 0f b6 04 38 84 c0 75 29 8b 13 0f ae f0 0f ae e8 41 83 fe 02 b8 00 04 00 00 41 0f 45 c6 b9 30 08 00 00 0f 30 <66> 90 5b 41 5e 41 5f 5d c3 cc cc cc cc 89 d9 80 e1 07 80 c1 03 38
RSP: 0018:ffffc90000bd76b8 EFLAGS: 00000206
RAX: 00000000000000fb RBX: ffff8880b8721170 RCX: 0000000000000830
RDX: 0000000000000001 RSI: 00000000000000fb RDI: 0000000000000001
RBP: ffffffff8e2eba98 R08: ffffffff81936eda R09: 1ffffffff2033b36
R10: dffffc0000000000 R11: ffffffff81493250 R12: dffffc0000000000
R13: ffff8880b863fb80 R14: 00000000000000fb R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005619e6807600 CR3: 000000000e736000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <NMI>
 </NMI>
 <TASK>
 arch_send_call_function_single_ipi arch/x86/include/asm/smp.h:94 [inline]
 send_call_function_single_ipi kernel/smp.c:118 [inline]
 smp_call_function_many_cond+0x15c6/0x2c60 kernel/smp.c:866
 on_each_cpu_cond_mask+0x3f/0x80 kernel/smp.c:1051
 text_poke_bp_batch+0x9ef/0xb30
 text_poke_flush arch/x86/kernel/alternative.c:2519 [inline]
 text_poke_finish+0x30/0x50 arch/x86/kernel/alternative.c:2526
 arch_jump_label_transform_apply+0x1c/0x30 arch/x86/kernel/jump_label.c:146
 static_key_enable_cpuslocked+0x136/0x260 kernel/jump_label.c:210
 static_key_enable+0x1a/0x20 kernel/jump_label.c:223
 toggle_allocation_gate+0xbc/0x260 mm/kfence/core.c:849
 process_one_work kernel/workqueue.c:3229 [inline]
 process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3310
 worker_thread+0x870/0xd30 kernel/workqueue.c:3391
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
INFO: NMI handler (nmi_cpu_backtrace_handler) took too long to run: 1.459 msecs

Crashes (106):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/08 08:58 linux-next af2ea8ab7a54 9ac0fdc6 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/02/14 10:24 upstream ab68d7eb7b1a d9a046cf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/02/14 03:19 upstream ab68d7eb7b1a d9a046cf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/02/14 03:18 upstream ab68d7eb7b1a d9a046cf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/02/12 13:51 upstream 09fbf3d50205 b27c2402 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/02/11 13:36 upstream febbc555cf0f 43f51a00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/02/06 03:06 upstream 92514ef226f5 577d049b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/02/06 02:02 upstream 92514ef226f5 577d049b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/02/05 12:54 upstream 5c8c229261f1 5896748e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/02/04 11:51 upstream 0de63bb7d919 8f267cef .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/02/04 01:43 upstream 2014c95afece a21a8419 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/02/02 07:37 upstream 69b8923f5003 568559e4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/27 03:47 upstream c2da8b3f914f 9fbd772e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/01/22 06:11 upstream b9d8a295ed6b da72ac06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/18 03:25 upstream 595523945be0 f2cb035c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/16 06:34 upstream 619f0b6fad52 968edaf4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/16 04:00 upstream 619f0b6fad52 968edaf4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/15 06:42 upstream 619f0b6fad52 7315a7cf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/14 20:38 upstream c3812b15000c f310a27d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/14 11:20 upstream c45323b7560e b1f1cd88 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/13 12:36 upstream 5bc55a333a2f 249ceea9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/13 04:49 upstream be548645527a 6dbc6a9b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/12 06:48 upstream b62cef9a5c67 6dbc6a9b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/12 05:15 upstream 77a903cd8e5a 6dbc6a9b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/01/12 03:16 upstream 77a903cd8e5a 6dbc6a9b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/01/12 00:34 upstream 77a903cd8e5a 6dbc6a9b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/01/12 00:28 upstream 77a903cd8e5a 6dbc6a9b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/01/10 19:03 upstream 2144da25584e 6dbc6a9b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/09 05:33 upstream 0b7958fa05d5 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/09 03:15 upstream 0b7958fa05d5 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/08 11:05 upstream 09a0fa92e5b4 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/08 05:46 upstream 09a0fa92e5b4 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/07 21:19 upstream fbfd64d25c7a f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/01/07 11:30 upstream fbfd64d25c7a f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/07 08:56 upstream fbfd64d25c7a f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/07 04:13 upstream 5428dc1906dd f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/06 23:22 upstream 5428dc1906dd f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/06 20:25 upstream 5428dc1906dd f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/06 11:44 upstream ab75170520d4 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/06 05:57 upstream ab75170520d4 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2025/01/05 22:50 upstream ab75170520d4 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/01/05 22:49 upstream ab75170520d4 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2024/12/13 18:16 upstream f932fb9b4074 3547e30f .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs INFO: task hung in btree_write_buffer_flush_seq
2024/11/06 08:21 upstream 2e1b3cc9d7f7 3a465482 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/02/08 15:56 linux-next ed58d103e6da ef44b750 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/01/13 18:48 linux-next 7b4b9bf203da 6dbc6a9b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/01/13 10:59 linux-next 7b4b9bf203da 6dbc6a9b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/01/06 21:49 linux-next 8155b4ef3466 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root INFO: task hung in btree_write_buffer_flush_seq
2025/02/10 20:36 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 2014c95afece 43f51a00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 INFO: task hung in btree_write_buffer_flush_seq
2024/12/26 05:22 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 573067a5a685 444551c4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-arm64 INFO: task hung in btree_write_buffer_flush_seq
* Struck through repros no longer work on HEAD.