syzbot


INFO: task hung in bch2_fs_read_only_work (2)

Status: upstream: reported syz repro on 2025/04/06 17:51
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+674ccd0645d379ed5f80@syzkaller.appspotmail.com
First crash: 5d10h, last: 5d10h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] INFO: task hung in bch2_fs_read_only_work (2) 2 (3) 2025/04/06 18:48
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream INFO: task hung in bch2_fs_read_only_work bcachefs C done inconclusive 286 103d 331d 0/28 auto-obsoleted due to no activity on 2025/03/05 14:23

Sample crash report:
INFO: task kworker/1:4:6586 blocked for more than 143 seconds.
      Not tainted 6.14.0-rc7-syzkaller-ga2392f333575 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/1:4     state:D stack:0     pid:6586  tgid:6586  ppid:2      task_flags:0x4208060 flags:0x00000008
Workqueue: events_long bch2_fs_read_only_work
Call trace:
 __switch_to+0x414/0x788 arch/arm64/kernel/process.c:701 (T)
 context_switch kernel/sched/core.c:5378 [inline]
 __schedule+0x1360/0x257c kernel/sched/core.c:6765
 __schedule_loop kernel/sched/core.c:6842 [inline]
 schedule+0xbc/0x238 kernel/sched/core.c:6857
 schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6914
 rwsem_down_write_slowpath+0xd10/0x14c8 kernel/locking/rwsem.c:1176
 __down_write_common kernel/locking/rwsem.c:1304 [inline]
 __down_write kernel/locking/rwsem.c:1313 [inline]
 down_write+0xb4/0xc0 kernel/locking/rwsem.c:1578
 bch2_fs_read_only_work+0x28/0x48 fs/bcachefs/super.c:393
 process_one_work+0x810/0x1638 kernel/workqueue.c:3238
 process_scheduled_works kernel/workqueue.c:3319 [inline]
 worker_thread+0x97c/0xeec kernel/workqueue.c:3400
 kthread+0x65c/0x7b0 kernel/kthread.c:464
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862
INFO: task syz.0.388:10111 blocked for more than 143 seconds.
      Not tainted 6.14.0-rc7-syzkaller-ga2392f333575 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.0.388       state:D stack:0     pid:10111 tgid:10110 ppid:6583   task_flags:0x400140 flags:0x0000000d
Call trace:
 __switch_to+0x414/0x788 arch/arm64/kernel/process.c:701 (T)
 context_switch kernel/sched/core.c:5378 [inline]
 __schedule+0x1360/0x257c kernel/sched/core.c:6765
 __schedule_loop kernel/sched/core.c:6842 [inline]
 schedule+0xbc/0x238 kernel/sched/core.c:6857
 __closure_sync+0x198/0x29c lib/closure.c:146
 closure_sync include/linux/closure.h:195 [inline]
 bch2_journal_flush_pins+0x1e0/0x348 fs/bcachefs/journal_reclaim.c:911
 bch2_journal_flush_all_pins fs/bcachefs/journal_reclaim.h:76 [inline]
 bch2_journal_replay+0x1c28/0x1f64 fs/bcachefs/recovery.c:442
 bch2_run_recovery_pass+0xe4/0x1d4 fs/bcachefs/recovery_passes.c:226
 bch2_run_recovery_passes+0x260/0x92c fs/bcachefs/recovery_passes.c:291
 bch2_fs_recovery+0x20e0/0x32ec fs/bcachefs/recovery.c:936
 bch2_fs_start+0x32c/0x570 fs/bcachefs/super.c:1041
 bch2_fs_get_tree+0xa50/0x11d4 fs/bcachefs/fs.c:2203
 vfs_get_tree+0x90/0x28c fs/super.c:1814
 do_new_mount+0x278/0x900 fs/namespace.c:3560
 path_mount+0x590/0xe04 fs/namespace.c:3887
 do_mount fs/namespace.c:3900 [inline]
 __do_sys_mount fs/namespace.c:4111 [inline]
 __se_sys_mount fs/namespace.c:4088 [inline]
 __arm64_sys_mount+0x4f4/0x5d0 fs/namespace.c:4088
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49
 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132
 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151
 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744
 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600

Showing all locks held in the system:
1 lock held by khungtaskd/32:
 #0: ffff80008ff22620 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire+0xc/0x44 include/linux/rcupdate.h:336
1 lock held by udevd/6081:
2 locks held by getty/6220:
 #0: ffff0000d74fa0a0 (&tty->ldisc_sem){++++}-{0:0}, at: ldsem_down_read+0x3c/0x4c drivers/tty/tty_ldsem.c:340
 #1: ffff80009bf4e2f0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x41c/0x1228 drivers/tty/n_tty.c:2211
3 locks held by kworker/1:4/6586:
 #0: ffff0000c0029548 ((wq_completion)events_long){+.+.}-{0:0}, at: process_one_work+0x674/0x1638 kernel/workqueue.c:3212
 #1: ffff80009f6b7ba0 ((work_completion)(&c->read_only_work)){+.+.}-{0:0}, at: process_one_work+0x708/0x1638 kernel/workqueue.c:3212
 #2: ffff0000e7500278 (&c->state_lock){+.+.}-{4:4}, at: bch2_fs_read_only_work+0x28/0x48 fs/bcachefs/super.c:393
1 lock held by syz.0.388/10111:
 #0: ffff0000e7500278 (&c->state_lock){+.+.}-{4:4}, at: bch2_fs_start+0x50/0x570 fs/bcachefs/super.c:1010
2 locks held by kworker/1:5/11232:
 #0: ffff0001b3772798 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested kernel/sched/core.c:598 [inline]
 #0: ffff0001b3772798 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock kernel/sched/sched.h:1521 [inline]
 #0: ffff0001b3772798 (&rq->__lock){-.-.}-{2:2}, at: rq_lock kernel/sched/sched.h:1852 [inline]
 #0: ffff0001b3772798 (&rq->__lock){-.-.}-{2:2}, at: __schedule+0x2e0/0x257c kernel/sched/core.c:6688
 #1: ffff0001b375d408 (&per_cpu_ptr(group->pcpu, cpu)->seq){-.-.}-{0:0}, at: psi_task_switch+0x394/0x5e8 kernel/sched/psi.c:987
2 locks held by syz.3.1147/16990:
2 locks held by syz.4.1148/16993:
 #0: ffff0000fc500920 (&c->sb_lock){+.+.}-{4:4}, at: bch2_fs_alloc fs/bcachefs/super.c:833 [inline]
 #0: ffff0000fc500920 (&c->sb_lock){+.+.}-{4:4}, at: bch2_fs_open+0x1238/0x299c fs/bcachefs/super.c:2065
 #1: ffff0000fc5049b0 (&c->mark_lock){++++}-{0:0}, at: bch2_sb_replicas_to_cpu_replicas+0x198/0x290 fs/bcachefs/replicas.c:600
3 locks held by syz.5.1149/17000:
2 locks held by syz.2.1150/17009:

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


Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/02 17:40 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a2392f333575 c799dfdd .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-arm64 INFO: task hung in bch2_fs_read_only_work
* Struck through repros no longer work on HEAD.