syzbot


INFO: task hung in bch2_seek_pagecache_hole (3)

Status: upstream: reported C repro on 2025/09/17 22:54
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+cb91f22d8a581fc19edf@syzkaller.appspotmail.com
First crash: 26d, last: 26d
Cause bisection: introduced by (bisect log) :
commit c02e5b57283ad6fd8dec8d834bd340bf2627fcee
Author: Kent Overstreet <kent.overstreet@linux.dev>
Date: Wed Apr 2 19:12:49 2025 +0000

  bcachefs: Single device mode

Crash: INFO: task hung in bch2_readahead (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] bcachefs: Fix deadlocks between fallocate and readahead 2 (2) 2025/09/27 08:40
[syzbot] [bcachefs?] INFO: task hung in bch2_seek_pagecache_hole (3) 0 (5) 2025/09/27 07:25
Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream INFO: task hung in bch2_seek_pagecache_hole bcachefs 1 1 520d 520d 0/29 auto-obsoleted due to no activity on 2024/07/10 22:21
upstream INFO: task hung in bch2_seek_pagecache_hole (2) bcachefs 1 1 249d 249d 0/29 auto-obsoleted due to no activity on 2025/05/07 16:14
Last patch testing requests (4)
Created Duration User Patch Repo Result
2025/10/04 05:31 20m retest repro upstream OK log
2025/10/04 05:31 19m retest repro upstream OK log
2025/09/27 07:25 20m kartikey406@gmail.com patch upstream OK log
2025/09/27 06:53 15m kartikey406@gmail.com patch upstream report log

Sample crash report:
INFO: task syz.0.17:6041 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.0.17        state:D stack:20072 pid:6041  tgid:6029  ppid:5982   task_flags:0x400040 flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5357 [inline]
 __schedule+0x16f3/0x4c20 kernel/sched/core.c:6961
 __schedule_loop kernel/sched/core.c:7043 [inline]
 schedule+0x165/0x360 kernel/sched/core.c:7058
 io_schedule+0x81/0xe0 kernel/sched/core.c:7903
 folio_wait_bit_common+0x6b5/0xb90 mm/filemap.c:1317
 __folio_lock mm/filemap.c:1675 [inline]
 folio_lock include/linux/pagemap.h:1133 [inline]
 __filemap_get_folio+0x167/0xa40 mm/filemap.c:1929
 folio_hole_offset fs/bcachefs/fs-io-pagecache.c:756 [inline]
 bch2_seek_pagecache_hole+0xbb/0x7c0 fs/bcachefs/fs-io-pagecache.c:793
 bch2_clamp_data_hole+0x8f/0x180 fs/bcachefs/fs-io-pagecache.c:808
 __bchfs_fallocate+0xe77/0x1870 fs/bcachefs/fs-io.c:697
 bchfs_fallocate+0x33f/0x680 fs/bcachefs/fs-io.c:789
 bch2_fallocate_dispatch+0x28d/0x410 fs/bcachefs/fs-io.c:836
 vfs_fallocate+0x672/0x7f0 fs/open.c:342
 ksys_fallocate fs/open.c:366 [inline]
 __do_sys_fallocate fs/open.c:371 [inline]
 __se_sys_fallocate fs/open.c:369 [inline]
 __x64_sys_fallocate+0xc0/0x110 fs/open.c:369
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fac8676eba9
RSP: 002b:00007fac85db5038 EFLAGS: 00000246 ORIG_RAX: 000000000000011d
RAX: ffffffffffffffda RBX: 00007fac869b6090 RCX: 00007fac8676eba9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00007fac867f1e19 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000001001ec R11: 0000000000000246 R12: 0000000000000000
R13: 00007fac869b6128 R14: 00007fac869b6090 R15: 00007ffd7cd492d8
 </TASK>
INFO: task syz.0.17:6042 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.0.17        state:D stack:26248 pid:6042  tgid:6029  ppid:5982   task_flags:0x440040 flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5357 [inline]
 __schedule+0x16f3/0x4c20 kernel/sched/core.c:6961
 __schedule_loop kernel/sched/core.c:7043 [inline]
 schedule+0x165/0x360 kernel/sched/core.c:7058
 __bch2_two_state_lock+0x1ea/0x370 fs/bcachefs/two_state_shared_lock.c:7
 bch2_two_state_lock fs/bcachefs/two_state_shared_lock.h:55 [inline]
 bch2_readahead+0x94f/0x1100 fs/bcachefs/fs-io-buffered.c:296
 read_pages+0x177/0x580 mm/readahead.c:160
 page_cache_ra_unbounded+0x63b/0x740 mm/readahead.c:297
 filemap_get_pages+0x443/0x1df0 mm/filemap.c:2603
 filemap_splice_read+0x587/0xc60 mm/filemap.c:2991
 do_splice_read fs/splice.c:982 [inline]
 splice_direct_to_actor+0x4b1/0xcd0 fs/splice.c:1086
 do_splice_direct_actor fs/splice.c:1204 [inline]
 do_splice_direct+0x187/0x270 fs/splice.c:1230
 vfs_copy_file_range+0xad7/0x1330 fs/read_write.c:1627
 __do_sys_copy_file_range fs/read_write.c:1677 [inline]
 __se_sys_copy_file_range+0x2fb/0x470 fs/read_write.c:1644
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fac8676eba9
RSP: 002b:00007fac85d94038 EFLAGS: 00000246 ORIG_RAX: 0000000000000146
RAX: ffffffffffffffda RBX: 00007fac869b6180 RCX: 00007fac8676eba9
RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00007fac867f1e19 R08: 0000000000000101 R09: 0000000000000000
R10: 00002000000000c0 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fac869b6218 R14: 00007fac869b6180 R15: 00007ffd7cd492d8
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/38:
 #0: ffffffff8d9a8d80 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
 #0: ffffffff8d9a8d80 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline]
 #0: ffffffff8d9a8d80 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x2e/0x180 kernel/locking/lockdep.c:6775
2 locks held by kworker/u8:2/43:
2 locks held by kworker/u8:3/57:
 #0: ffff888019881138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
 #0: ffff888019881138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0 kernel/workqueue.c:3319
 #1: ffffc9000123fbc0 ((reaper_work).work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
 #1: ffffc9000123fbc0 ((reaper_work).work){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0 kernel/workqueue.c:3319
2 locks held by kworker/u8:13/3562:
 #0: ffff888019881138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
 #0: ffff888019881138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0 kernel/workqueue.c:3319
 #1: ffffc9000d6c7bc0 (connector_reaper_work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
 #1: ffffc9000d6c7bc0 (connector_reaper_work){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0 kernel/workqueue.c:3319
2 locks held by getty/5599:
 #0: ffff88823bf668a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
 #1: ffffc90003e832e0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x444/0x1410 drivers/tty/n_tty.c:2222
3 locks held by syz.0.17/6041:
 #0: ffff888036f5c488 (sb_writers#12){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3108 [inline]
 #0: ffff888036f5c488 (sb_writers#12){.+.+}-{0:0}, at: vfs_fallocate+0x5f9/0x7f0 fs/open.c:341
 #1: ffff8880583a89b8 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:870 [inline]
 #1: ffff8880583a89b8 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: bch2_fallocate_dispatch+0x111/0x410 fs/bcachefs/fs-io.c:827
 #2: ffff888047904678 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:161 [inline]
 #2: ffff888047904678 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:253 [inline]
 #2: ffff888047904678 (&c->btree_trans_barrier){.+.+}-{0:0}, at: bch2_trans_srcu_lock+0xaf/0x220 fs/bcachefs/btree_iter.c:3299
1 lock held by syz.0.17/6042:
 #0: ffff8880583a8b88 (mapping.invalidate_lock#3){.+.+}-{4:4}, at: filemap_invalidate_lock_shared include/linux/fs.h:935 [inline]
 #0: ffff8880583a8b88 (mapping.invalidate_lock#3){.+.+}-{4:4}, at: page_cache_ra_unbounded+0xf4/0x740 mm/readahead.c:228
2 locks held by syz-executor/6051:
1 lock held by udevd/6054:

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

NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 38 Comm: khungtaskd Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 nmi_cpu_backtrace+0x39e/0x3d0 lib/nmi_backtrace.c:113
 nmi_trigger_cpumask_backtrace+0x17a/0x300 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:160 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:328 [inline]
 watchdog+0xf93/0xfe0 kernel/hung_task.c:491
 kthread+0x70e/0x8a0 kernel/kthread.c:463
 ret_from_fork+0x439/0x7d0 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 6054 Comm: udevd Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
RIP: 0010:match_held_lock+0x0/0xc0 kernel/locking/lockdep.c:5305
Code: 41 5e 41 5f c3 cc cc cc cc cc e8 fb f8 ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 <41> 56 53 bb 01 00 00 00 48 39 77 10 74 6a 81 7f 20 00 00 20 00 72
RSP: 0018:ffffc90004b077e0 EFLAGS: 00000046
RAX: 00000000000600cc RBX: 000000000000000a RCX: ead64c1d57cd1b00
RDX: 0000000000000000 RSI: ffff8880581d2b60 RDI: ffff88802c280b48
RBP: ffff88802c280b48 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: ffffed100b03a55c R12: 0000000000000002
R13: 0000000000000001 R14: ffff8880581d2b60 R15: ffff88802c280000
FS:  00007f190aa88880(0000) GS:ffff8881268bc000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1419fb5000 CR3: 000000002f922000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 find_held_lock kernel/locking/lockdep.c:5364 [inline]
 __lock_release kernel/locking/lockdep.c:5535 [inline]
 lock_release+0x241/0x3e0 kernel/locking/lockdep.c:5889
 rt_spin_unlock+0x16/0x80 kernel/locking/spinlock_rt.c:80
 spin_unlock include/linux/spinlock_rt.h:105 [inline]
 __d_lookup+0x624/0x780 fs/dcache.c:2408
 lookup_fast+0x84/0x5b0 fs/namei.c:1766
 walk_component+0x55/0x400 fs/namei.c:2125
 lookup_last fs/namei.c:2630 [inline]
 path_lookupat+0x163/0x430 fs/namei.c:2654
 filename_lookup+0x212/0x570 fs/namei.c:2683
 vfs_statx+0xf8/0x550 fs/stat.c:353
 vfs_fstatat+0x118/0x170 fs/stat.c:375
 __do_sys_newfstatat fs/stat.c:542 [inline]
 __se_sys_newfstatat fs/stat.c:536 [inline]
 __x64_sys_newfstatat+0x116/0x190 fs/stat.c:536
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f190abe0b0a
Code: 48 8b 15 f1 f2 0d 00 f7 d8 64 89 02 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 41 89 ca b8 06 01 00 00 0f 05 <3d> 00 f0 ff ff 77 07 31 c0 c3 0f 1f 40 00 48 8b 15 b9 f2 0d 00 f7
RSP: 002b:00007ffdadcb1708 EFLAGS: 00000246 ORIG_RAX: 0000000000000106
RAX: ffffffffffffffda RBX: 000000000000002d RCX: 00007f190abe0b0a
RDX: 00007ffdadcb1710 RSI: 00007ffdadcb17e0 RDI: 00000000ffffff9c
RBP: 00007ffdadcb2820 R08: 00007ffdadcb3450 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffdadcb3450
R13: 0000000000000000 R14: 00007ffdadcb3050 R15: 00007ffdadcb2c50
 </TASK>

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/17 18:35 upstream 5aca7966d2a7 e2beed91 .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs INFO: task hung in bch2_seek_pagecache_hole
2025/09/17 12:10 upstream 5aca7966d2a7 e2beed91 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs INFO: task hung in bch2_seek_pagecache_hole
2025/09/17 05:13 upstream 5aca7966d2a7 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in bch2_seek_pagecache_hole
* Struck through repros no longer work on HEAD.