syzbot


INFO: task hung in bch2_mark_pagecache_unallocated (3)

Status: upstream: reported syz repro on 2025/09/27 14:03
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+94b822fda1fb3f24f1da@syzkaller.appspotmail.com
First crash: 95d, last: 4d13h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] INFO: task hung in bch2_mark_pagecache_unallocated (3) 0 (1) 2025/09/27 14:03
Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream INFO: task hung in bch2_mark_pagecache_unallocated (2) bcachefs 1 1 338d 338d 0/29 auto-obsoleted due to no activity on 2025/01/22 17:35
upstream INFO: task hung in bch2_mark_pagecache_unallocated bcachefs 1 3 440d 464d 0/29 auto-obsoleted due to no activity on 2024/10/12 08:01

Sample crash report:
INFO: task syz.1.152:8462 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.1.152       state:D stack:0     pid:8462  tgid:8423  ppid:6684   task_flags:0x400140 flags:0x00000011
Call trace:
 __switch_to+0x418/0x87c arch/arm64/kernel/process.c:741 (T)
 context_switch kernel/sched/core.c:5357 [inline]
 __schedule+0x13b0/0x2864 kernel/sched/core.c:6961
 __schedule_loop kernel/sched/core.c:7043 [inline]
 schedule+0xb4/0x230 kernel/sched/core.c:7058
 io_schedule+0x84/0xf0 kernel/sched/core.c:7903
 folio_wait_bit_common+0x56c/0x9e0 mm/filemap.c:1317
 __folio_lock+0x2c/0x3c mm/filemap.c:1675
 folio_lock include/linux/pagemap.h:1133 [inline]
 bch2_mark_pagecache_unallocated+0x310/0x6c8 fs/bcachefs/fs-io-pagecache.c:275
 bch2_remap_file_range+0x598/0xb70 fs/bcachefs/fs-io.c:933
 vfs_clone_file_range+0x62c/0xb68 fs/remap_range.c:403
 ioctl_file_clone fs/ioctl.c:240 [inline]
 ioctl_file_clone_range fs/ioctl.c:258 [inline]
 do_vfs_ioctl+0xb84/0x1834 fs/ioctl.c:545
 __do_sys_ioctl fs/ioctl.c:596 [inline]
 __se_sys_ioctl fs/ioctl.c:584 [inline]
 __arm64_sys_ioctl+0xe4/0x1c4 fs/ioctl.c:584
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x98/0x254 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+0x5c/0x254 arch/arm64/kernel/entry-common.c:744
 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:763
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596
INFO: task syz.1.152:8464 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.1.152       state:D stack:0     pid:8464  tgid:8423  ppid:6684   task_flags:0x440040 flags:0x00000001
Call trace:
 __switch_to+0x418/0x87c arch/arm64/kernel/process.c:741 (T)
 context_switch kernel/sched/core.c:5357 [inline]
 __schedule+0x13b0/0x2864 kernel/sched/core.c:6961
 __schedule_loop kernel/sched/core.c:7043 [inline]
 schedule+0xb4/0x230 kernel/sched/core.c:7058
 __bch2_two_state_lock+0x1b4/0x2f0 fs/bcachefs/two_state_shared_lock.c:7
 bch2_two_state_lock fs/bcachefs/two_state_shared_lock.h:55 [inline]
 bch2_readahead+0xbc8/0xd88 fs/bcachefs/fs-io-buffered.c:296
 read_pages+0x13c/0x4c4 mm/readahead.c:160
 page_cache_ra_order+0x7a0/0xb7c mm/readahead.c:512
 page_cache_sync_ra+0x580/0x73c mm/readahead.c:619
 filemap_get_pages+0x2f4/0x19c8 mm/filemap.c:2603
 filemap_splice_read+0x454/0xad8 mm/filemap.c:2991
 do_splice_read fs/splice.c:982 [inline]
 splice_file_to_pipe+0x374/0x5a8 fs/splice.c:1292
 do_sendfile+0x37c/0x658 fs/read_write.c:1376
 __do_sys_sendfile64 fs/read_write.c:1431 [inline]
 __se_sys_sendfile64 fs/read_write.c:1417 [inline]
 __arm64_sys_sendfile64+0x1b4/0x274 fs/read_write.c:1417
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x98/0x254 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+0x5c/0x254 arch/arm64/kernel/entry-common.c:744
 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:763
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596

Showing all locks held in the system:
2 locks held by kworker/u8:0/12:
1 lock held by khungtaskd/32:
 #0: ffff80008f9d9620 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire+0x4/0x48 include/linux/rcupdate.h:330
1 lock held by klogd/6160:
2 locks held by getty/6313:
 #0: ffff0000d35390a0 (&tty->ldisc_sem){++++}-{0:0}, at: ldsem_down_read+0x3c/0x4c drivers/tty/tty_ldsem.c:340
 #1: ffff800099e8e2f0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x34c/0xfa4 drivers/tty/n_tty.c:2222
1 lock held by syz-executor/6571:
 #0: ffff0000c696fc68 (&pipe->mutex){+.+.}-{4:4}, at: pipe_release+0x54/0x2fc fs/pipe.c:727
2 locks held by syz.1.152/8462:
 #0: ffff0000cf3a0428 (sb_writers#11){.+.+}-{0:0}, at: ioctl_file_clone fs/ioctl.c:240 [inline]
 #0: ffff0000cf3a0428 (sb_writers#11){.+.+}-{0:0}, at: ioctl_file_clone_range fs/ioctl.c:258 [inline]
 #0: ffff0000cf3a0428 (sb_writers#11){.+.+}-{0:0}, at: do_vfs_ioctl+0xb84/0x1834 fs/ioctl.c:545
 #1: ffff0000f9f89078 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:870 [inline]
 #1: ffff0000f9f89078 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: lock_two_nondirectories+0xc4/0x150 fs/inode.c:1232
2 locks held by syz.1.152/8464:
 #0: ffff0000c696fc68 (&pipe->mutex){+.+.}-{4:4}, at: pipe_lock+0x68/0x98 fs/pipe.c:91
 #1: ffff0000f9f89218 (mapping.invalidate_lock#3){.+.+}-{4:4}, at: filemap_invalidate_lock_shared include/linux/fs.h:935 [inline]
 #1: ffff0000f9f89218 (mapping.invalidate_lock#3){.+.+}-{4:4}, at: page_cache_ra_order+0x268/0xb7c mm/readahead.c:488

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


Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/23 13:56 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci b5db4add5e77 0ac7291c .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-arm64 INFO: task hung in bch2_mark_pagecache_unallocated
2025/07/04 13:23 upstream 4c06e63b9203 76ad128c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in bch2_mark_pagecache_unallocated
2025/06/24 03:58 upstream 78f4e737a53e e2f27c35 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in bch2_mark_pagecache_unallocated
2025/09/18 12:54 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 6edf2885ebeb e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 INFO: task hung in bch2_mark_pagecache_unallocated
* Struck through repros no longer work on HEAD.