[syzbot] [bcachefs?] INFO: task hung in bch2_fs_read_only_work

32 views
Skip to first unread message

syzbot

unread,
May 11, 2024, 6:46:24 PMMay 11
to bfo...@redhat.com, kent.ov...@linux.dev, linux-b...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: cf87f46fd34d Merge tag 'drm-fixes-2024-05-11' of https://g..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=14c8766c980000
kernel config: https://syzkaller.appspot.com/x/.config?x=6d14c12b661fb43
dashboard link: https://syzkaller.appspot.com/bug?extid=8996d8f176cf946ef641
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1aa5ad92dfce/disk-cf87f46f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/67c336f7c1c7/vmlinux-cf87f46f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/bb5b717bd2b8/bzImage-cf87f46f.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+8996d8...@syzkaller.appspotmail.com

INFO: task kworker/0:5:19779 blocked for more than 143 seconds.
Not tainted 6.9.0-rc7-syzkaller-00183-gcf87f46fd34d #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:5 state:D stack:28464 pid:19779 tgid:19779 ppid:2 flags:0x00004000
Workqueue: events_long bch2_fs_read_only_work
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5409 [inline]
__schedule+0x17e8/0x4a50 kernel/sched/core.c:6746
__schedule_loop kernel/sched/core.c:6823 [inline]
schedule+0x14b/0x320 kernel/sched/core.c:6838
schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6895
rwsem_down_write_slowpath+0xeeb/0x13b0 kernel/locking/rwsem.c:1178
__down_write_common+0x1af/0x200 kernel/locking/rwsem.c:1306
bch2_fs_read_only_work+0x25/0x40 fs/bcachefs/super.c:393
process_one_work kernel/workqueue.c:3267 [inline]
process_scheduled_works+0xa12/0x17c0 kernel/workqueue.c:3348
worker_thread+0x86d/0xd70 kernel/workqueue.c:3429
kthread+0x2f2/0x390 kernel/kthread.c:388
ret_from_fork+0x4d/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/29:
#0: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
#0: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
#0: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x55/0x2a0 kernel/locking/lockdep.c:6614
2 locks held by kworker/u8:6/1095:
2 locks held by getty/4840:
#0: ffff88802cc100a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
#1: ffffc900031332f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6b5/0x1e10 drivers/tty/n_tty.c:2201
1 lock held by syz-fuzzer/5098:
5 locks held by syz-executor.4/19737:
3 locks held by kworker/0:5/19779:
#0: ffff888015079148 ((wq_completion)events_long){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3242 [inline]
#0: ffff888015079148 ((wq_completion)events_long){+.+.}-{0:0}, at: process_scheduled_works+0x8e0/0x17c0 kernel/workqueue.c:3348
#1: ffffc9000cf67d00 ((work_completion)(&c->read_only_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3243 [inline]
#1: ffffc9000cf67d00 ((work_completion)(&c->read_only_work)){+.+.}-{0:0}, at: process_scheduled_works+0x91b/0x17c0 kernel/workqueue.c:3348
#2: ffff88803de00278 (&c->state_lock){+.+.}-{3:3}, at: bch2_fs_read_only_work+0x25/0x40 fs/bcachefs/super.c:393
6 locks held by kworker/1:15/19807:
#0: ffff88801beda548 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3242 [inline]
#0: ffff88801beda548 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_scheduled_works+0x8e0/0x17c0 kernel/workqueue.c:3348
#1: ffffc9000dfb7d00 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3243 [inline]
#1: ffffc9000dfb7d00 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_scheduled_works+0x91b/0x17c0 kernel/workqueue.c:3348
#2: ffff88802374b190 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:990 [inline]
#2: ffff88802374b190 (&dev->mutex){....}-{3:3}, at: hub_event+0x1fe/0x5150 drivers/usb/core/hub.c:5850
#3: ffff88802374e518 (&port_dev->status_lock){+.+.}-{3:3}, at: usb_lock_port drivers/usb/core/hub.c:3207 [inline]
#3: ffff88802374e518 (&port_dev->status_lock){+.+.}-{3:3}, at: hub_port_connect drivers/usb/core/hub.c:5419 [inline]
#3: ffff88802374e518 (&port_dev->status_lock){+.+.}-{3:3}, at: hub_port_connect_change drivers/usb/core/hub.c:5662 [inline]
#3: ffff88802374e518 (&port_dev->status_lock){+.+.}-{3:3}, at: port_event drivers/usb/core/hub.c:5822 [inline]
#3: ffff88802374e518 (&port_dev->status_lock){+.+.}-{3:3}, at: hub_event+0x25b6/0x5150 drivers/usb/core/hub.c:5904
#4: ffff888022fb6568 (hcd->address0_mutex){+.+.}-{3:3}, at: hub_port_connect drivers/usb/core/hub.c:5420 [inline]
#4: ffff888022fb6568 (hcd->address0_mutex){+.+.}-{3:3}, at: hub_port_connect_change drivers/usb/core/hub.c:5662 [inline]
#4: ffff888022fb6568 (hcd->address0_mutex){+.+.}-{3:3}, at: port_event drivers/usb/core/hub.c:5822 [inline]
#4: ffff888022fb6568 (hcd->address0_mutex){+.+.}-{3:3}, at: hub_event+0x25f4/0x5150 drivers/usb/core/hub.c:5904
#5: ffffffff8ef0a6b0 (ehci_cf_port_reset_rwsem){.+.+}-{3:3}, at: hub_port_reset+0x1f8/0x1b30 drivers/usb/core/hub.c:3022
2 locks held by syz-executor.3/21870:
2 locks held by syz-executor.5/21874:
2 locks held by syz-executor.1/21881:

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

NMI backtrace for cpu 0
CPU: 0 PID: 29 Comm: khungtaskd Not tainted 6.9.0-rc7-syzkaller-00183-gcf87f46fd34d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
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:160 [inline]
check_hung_uninterruptible_tasks kernel/hung_task.c:223 [inline]
watchdog+0xfde/0x1020 kernel/hung_task.c:380
kthread+0x2f2/0x390 kernel/kthread.c:388
ret_from_fork+0x4d/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 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 21874 Comm: syz-executor.5 Not tainted 6.9.0-rc7-syzkaller-00183-gcf87f46fd34d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
RIP: 0010:native_save_fl arch/x86/include/asm/irqflags.h:32 [inline]
RIP: 0010:arch_local_save_flags arch/x86/include/asm/irqflags.h:67 [inline]
RIP: 0010:arch_local_irq_save arch/x86/include/asm/irqflags.h:103 [inline]
RIP: 0010:lock_release+0x16d/0x9f0 kernel/locking/lockdep.c:5770
Code: eb 03 42 80 3c 3b 00 74 08 4c 89 f7 e8 ac 09 88 00 4c 89 6c 24 50 48 c7 84 24 b0 00 00 00 00 00 00 00 9c 8f 84 24 b0 00 00 00 <42> 80 3c 3b 00 74 08 4c 89 f7 e8 94 08 88 00 48 8b 9c 24 b0 00 00
RSP: 0018:ffffc9000bb0f680 EFLAGS: 00000246
RAX: 0000000000000000 RBX: 1ffff92001761ee6 RCX: ffffffff8172abb0
RDX: 0000000000000000 RSI: ffffffff8c1f8240 RDI: ffffffff8c1f8200
RBP: ffffc9000bb0f7b0 R08: ffffffff8fa8f92f R09: 1ffffffff1f51f25
R10: dffffc0000000000 R11: fffffbfff1f51f26 R12: 1ffff92001761edc
R13: ffffffff81cbece7 R14: ffffc9000bb0f730 R15: dffffc0000000000
FS: 00007f5fc8c356c0(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fadd80ffe00 CR3: 00000000553c2000 CR4: 0000000000350ef0
Call Trace:
<NMI>
</NMI>
<TASK>
rcu_lock_release include/linux/rcupdate.h:339 [inline]
rcu_read_unlock include/linux/rcupdate.h:814 [inline]
filemap_get_entry+0x457/0x4e0 mm/filemap.c:1834
shmem_get_folio_gfp+0x2a8/0x1f50 mm/shmem.c:1982
shmem_get_folio mm/shmem.c:2160 [inline]
shmem_write_begin+0x170/0x4d0 mm/shmem.c:2744
generic_perform_write+0x324/0x640 mm/filemap.c:3974
shmem_file_write_iter+0xfc/0x120 mm/shmem.c:2920
call_write_iter include/linux/fs.h:2110 [inline]
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0xa86/0xcb0 fs/read_write.c:590
ksys_write+0x1a0/0x2c0 fs/read_write.c:643
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5fc7e7caaf
Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 b9 80 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 0c 81 02 00 48
RSP: 002b:00007f5fc8c34e80 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000001000000 RCX: 00007f5fc7e7caaf
RDX: 0000000001000000 RSI: 00007f5fbdc00000 RDI: 0000000000000004
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000009855
R10: 0000000000000002 R11: 0000000000000293 R12: 0000000000000004
R13: 00007f5fc8c34f80 R14: 00007f5fc8c34f40 R15: 00007f5fbdc00000
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Jun 3, 2024, 11:28:26 PMJun 3
to bfo...@redhat.com, kent.ov...@linux.dev, linux-b...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: f06ce441457d Merge tag 'loongarch-fixes-6.10-1' of git://g..
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=17802a16980000
kernel config: https://syzkaller.appspot.com/x/.config?x=eb72437243175f22
dashboard link: https://syzkaller.appspot.com/bug?extid=8996d8f176cf946ef641
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=164255f2980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16174432980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/00ecb7bdd1a8/disk-f06ce441.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/3926ab949197/vmlinux-f06ce441.xz
kernel image: https://storage.googleapis.com/syzbot-assets/36849eea4fc5/bzImage-f06ce441.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/bfad9a4a2dc4/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+8996d8...@syzkaller.appspotmail.com

INFO: task kworker/1:0:25 blocked for more than 143 seconds.
Not tainted 6.10.0-rc2-syzkaller-00007-gf06ce441457d #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/1:0 state:D
stack:26248 pid:25 tgid:25 ppid:2 flags:0x00004000
Workqueue: events_long bch2_fs_read_only_work
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5408 [inline]
__schedule+0x1796/0x49d0 kernel/sched/core.c:6745
__schedule_loop kernel/sched/core.c:6822 [inline]
schedule+0x14b/0x320 kernel/sched/core.c:6837
schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6894
rwsem_down_write_slowpath+0xeeb/0x13b0 kernel/locking/rwsem.c:1178
__down_write_common+0x1af/0x200 kernel/locking/rwsem.c:1306
bch2_fs_read_only_work+0x25/0x40 fs/bcachefs/super.c:392
process_one_work kernel/workqueue.c:3231 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312
worker_thread+0x86d/0xd70 kernel/workqueue.c:3393
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:
3 locks held by kworker/1:0/25:
#0: ffff888015081148 ((wq_completion)events_long){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3206 [inline]
#0: ffff888015081148 ((wq_completion)events_long){+.+.}-{0:0}, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3312
#1: ffffc900001f7d00 ((work_completion)(&c->read_only_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3207 [inline]
#1: ffffc900001f7d00 ((work_completion)(&c->read_only_work)){+.+.}-{0:0}, at: process_scheduled_works+0x945/0x1830 kernel/workqueue.c:3312
#2: ffff888075980278 (&c->state_lock){+.+.}-{3:3}, at: bch2_fs_read_only_work+0x25/0x40 fs/bcachefs/super.c:392
1 lock held by khungtaskd/30:
#0: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
#0: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
#0: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x55/0x2a0 kernel/locking/lockdep.c:6614
5 locks held by kworker/u8:2/35:
1 lock held by klogd/4522:
2 locks held by getty/4833:
#0: ffff88802fb4a0a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
#1: ffffc90002f062f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6b5/0x1e10 drivers/tty/n_tty.c:2201
3 locks held by syz-executor131/5078:

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

NMI backtrace for cpu 1
CPU: 1 PID: 30 Comm: khungtaskd Not tainted 6.10.0-rc2-syzkaller-00007-gf06ce441457d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
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:223 [inline]
watchdog+0xfde/0x1020 kernel/hung_task.c:379
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 PID: 4515 Comm: syslogd Not tainted 6.10.0-rc2-syzkaller-00007-gf06ce441457d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
RIP: 0010:skb_ext_put include/linux/skbuff.h:4688 [inline]
RIP: 0010:skb_release_head_state+0x19d/0x250 net/core/skbuff.c:1165
Code: 4e f8 eb 16 31 ff 89 ee e8 80 50 4e f8 85 ed 0f 8e 8a 00 00 00 e8 33 4c 4e f8 49 8d 5e 7f 48 89 d8 48 c1 e8 03 42 0f b6 04 20 <84> c0 0f 85 84 00 00 00 0f b6 1b 31 ff 89 de e8 0f 4f 4e f8 85 db
RSP: 0018:ffffc90004907908 EFLAGS: 00000a07
RAX: 0000000000000000 RBX: ffff88802e28ecff RCX: ffff88807d280000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff8947c904 R09: 1ffff11003ca5853
R10: dffffc0000000000 R11: ffffed1003ca5854 R12: dffffc0000000000
R13: ffff88802e28ec80 R14: ffff88802e28ec80 R15: ffff88802e28ece0
FS: 00007fa63915c380(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055e2897e7600 CR3: 000000002dc2c000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<NMI>
</NMI>
<TASK>
skb_release_all net/core/skbuff.c:1171 [inline]
__kfree_skb net/core/skbuff.c:1187 [inline]
consume_skb+0x7b/0x160 net/core/skbuff.c:1409
__unix_dgram_recvmsg+0xcea/0x12f0 net/unix/af_unix.c:2474
sock_recvmsg_nosec net/socket.c:1046 [inline]
sock_recvmsg+0x22f/0x280 net/socket.c:1068
sock_read_iter+0x2ca/0x3e0 net/socket.c:1138
new_sync_read fs/read_write.c:395 [inline]
vfs_read+0x9c4/0xbd0 fs/read_write.c:476
ksys_read+0x1a0/0x2c0 fs/read_write.c:619
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fa6392b0b6a
Code: 00 3d 00 00 41 00 75 0d 50 48 8d 3d 2d 08 0a 00 e8 ea 7d 01 00 31 c0 e9 07 ff ff ff 64 8b 04 25 18 00 00 00 85 c0 75 1b 0f 05 <48> 3d 00 f0 ff ff 76 6c 48 8b 15 8f a2 0d 00 f7 d8 64 89 02 48 83
RSP: 002b:00007ffec9bf54e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007fa6392b0b6a
RDX: 00000000000000ff RSI: 000055cf5b545950 RDI: 0000000000000000
RBP: 000055cf5b545910 R08: 0000000000000001 R09: 0000000000000000
R10: 00007fa63944f3a3 R11: 0000000000000246 R12: 000055cf5b54598a
R13: 000055cf5b545950 R14: 0000000000000000 R15: 00007fa639493a80
</TASK>
INFO: NMI handler (nmi_cpu_backtrace_handler) took too long to run: 1.151 msecs


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

syzbot

unread,
Jun 4, 2024, 7:26:04 AMJun 4
to bfo...@redhat.com, kent.ov...@linux.dev, linux-b...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
syzbot has bisected this issue to:

commit 03ef80b469d5d83530ce1ce15be78a40e5300f9b
Author: Kent Overstreet <kent.ov...@linux.dev>
Date: Sat Sep 23 22:41:51 2023 +0000

bcachefs: Ignore unknown mount options

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1526df2c980000
start commit: f06ce441457d Merge tag 'loongarch-fixes-6.10-1' of git://g..
git tree: upstream
final oops: https://syzkaller.appspot.com/x/report.txt?x=1726df2c980000
console output: https://syzkaller.appspot.com/x/log.txt?x=1326df2c980000
Reported-by: syzbot+8996d8...@syzkaller.appspotmail.com
Fixes: 03ef80b469d5 ("bcachefs: Ignore unknown mount options")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

Hillf Danton

unread,
Jun 30, 2024, 5:24:42 AM (3 days ago) Jun 30
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Mon, 03 Jun 2024 20:28:24 -0700
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: f06ce441457d Merge tag 'loongarch-fixes-6.10-1' of git://g..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16174432980000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

syzbot

unread,
Jun 30, 2024, 6:37:05 AM (3 days ago) Jun 30
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
INFO: task hung in bch2_fs_read_only_work

INFO: task kworker/0:1:9 blocked for more than 143 seconds.
Not tainted 6.10.0-rc5-syzkaller-00282-g8282d5af7be8 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:1 state:D stack:22864 pid:9 tgid:9 ppid:2 flags:0x00004000
Workqueue: events_long bch2_fs_read_only_work

Call Trace:
<TASK>
context_switch kernel/sched/core.c:5408 [inline]
__schedule+0x1796/0x49d0 kernel/sched/core.c:6745
__schedule_loop kernel/sched/core.c:6822 [inline]
schedule+0x14b/0x320 kernel/sched/core.c:6837
schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6894
rwsem_down_write_slowpath+0xeeb/0x13b0 kernel/locking/rwsem.c:1178
__down_write_common+0x1af/0x200 kernel/locking/rwsem.c:1306
bch2_fs_read_only_work+0x25/0x40 fs/bcachefs/super.c:392
process_one_work kernel/workqueue.c:3248 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3329
worker_thread+0x86d/0xd50 kernel/workqueue.c:3409
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:
3 locks held by kworker/0:1/9:
#0: ffff888015081148 ((wq_completion)events_long){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3223 [inline]
#0: ffff888015081148 ((wq_completion)events_long){+.+.}-{0:0}, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3329
#1: ffffc900000e7d00 ((work_completion)(&c->read_only_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3224 [inline]
#1: ffffc900000e7d00 ((work_completion)(&c->read_only_work)){+.+.}-{0:0}, at: process_scheduled_works+0x945/0x1830 kernel/workqueue.c:3329
#2: ffff888061300278 (&c->state_lock){+.+.}-{3:3}, at: bch2_fs_read_only_work+0x25/0x40 fs/bcachefs/super.c:392
1 lock held by khungtaskd/30:
#0: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
#0: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
#0: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x55/0x2a0 kernel/locking/lockdep.c:6614
2 locks held by getty/4830:
#0: ffff88802d5a00a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
#1: ffffc90002f0e2f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6b5/0x1e10 drivers/tty/n_tty.c:2211
3 locks held by syz-executor/5952:
2 locks held by syz-executor/6492:

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

NMI backtrace for cpu 0
CPU: 0 PID: 30 Comm: khungtaskd Not tainted 6.10.0-rc5-syzkaller-00282-g8282d5af7be8 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
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:223 [inline]
watchdog+0xfde/0x1020 kernel/hung_task.c:379
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 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 4522 Comm: klogd Not tainted 6.10.0-rc5-syzkaller-00282-g8282d5af7be8 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
RIP: 0010:on_stack arch/x86/include/asm/stacktrace.h:58 [inline]
RIP: 0010:stack_access_ok arch/x86/kernel/unwind_orc.c:393 [inline]
RIP: 0010:deref_stack_reg+0xb6/0x260 arch/x86/kernel/unwind_orc.c:403
Code: 00 00 00 00 fc ff df 41 0f b6 04 06 84 c0 0f 85 77 01 00 00 8b 2b 31 ff 89 ee e8 75 11 55 00 85 ed 48 8b 2c 24 48 8b 4c 24 20 <74> 22 48 39 e9 77 1d 49 39 ef 76 18 48 8d 45 08 48 39 c8 76 16 4c
RSP: 0018:ffffc900030171c8 EFLAGS: 00000202
RAX: 0000000000000000 RBX: ffffc90003017300 RCX: ffffc90003010000
RDX: ffff88807cddbc00 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc90003017f48 R08: ffffffff81411deb R09: ffffffff8141095f
R10: 0000000000000003 R11: ffff88807cddbc00 R12: 1ffff92000602e61
R13: 1ffff92000602e62 R14: 1ffff92000602e60 R15: ffffc90003018000
FS: 00007f77d92e5380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fd9881b0000 CR3: 000000002dbc8000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<NMI>
</NMI>
<TASK>
unwind_next_frame+0x1ab8/0x2a00 arch/x86/kernel/unwind_orc.c:648
arch_stack_walk+0x151/0x1b0 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x118/0x1d0 kernel/stacktrace.c:122
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:4123 [inline]
kmalloc_node_track_caller_noprof+0x225/0x440 mm/slub.c:4143
kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:597
__alloc_skb+0x1f3/0x440 net/core/skbuff.c:666
alloc_skb include/linux/skbuff.h:1308 [inline]
alloc_skb_with_frags+0xc3/0x770 net/core/skbuff.c:6504
sock_alloc_send_pskb+0x91a/0xa60 net/core/sock.c:2794
unix_dgram_sendmsg+0x6d3/0x1f80 net/unix/af_unix.c:1976
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg+0x221/0x270 net/socket.c:745
__sys_sendto+0x3a4/0x4f0 net/socket.c:2192
__do_sys_sendto net/socket.c:2204 [inline]
__se_sys_sendto net/socket.c:2200 [inline]
__x64_sys_sendto+0xde/0x100 net/socket.c:2200
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f77d94479b5
Code: 8b 44 24 08 48 83 c4 28 48 98 c3 48 98 c3 41 89 ca 64 8b 04 25 18 00 00 00 85 c0 75 26 45 31 c9 45 31 c0 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 76 7a 48 8b 15 44 c4 0c 00 f7 d8 64 89 02 48 83
RSP: 002b:00007fff73f971d8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f77d94479b5
RDX: 000000000000004c RSI: 000055e9ea82c7b0 RDI: 0000000000000003
RBP: 000055e9ea827910 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000004000 R11: 0000000000000246 R12: 0000000000000013
R13: 00007f77d95d5212 R14: 00007fff73f972d8 R15: 0000000000000000
</TASK>


Tested on:

commit: 8282d5af Merge tag 'nfs-for-6.10-3' of git://git.linux..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=11eae41a980000
kernel config: https://syzkaller.appspot.com/x/.config?x=bf5def5af476d39a
dashboard link: https://syzkaller.appspot.com/bug?extid=8996d8f176cf946ef641
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.

Hillf Danton

unread,
Jun 30, 2024, 7:40:00 AM (3 days ago) Jun 30
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
--- x/fs/bcachefs/btree_locking.c
+++ y/fs/bcachefs/btree_locking.c
@@ -10,7 +10,6 @@ void bch2_btree_lock_init(struct btree_b
enum six_lock_init_flags flags)
{
__six_lock_init(&b->lock, "b->c.lock", &bch2_btree_node_lock_key, flags);
- lockdep_set_novalidate_class(&b->lock);
}

#ifdef CONFIG_LOCKDEP
--

syzbot

unread,
Jun 30, 2024, 8:37:05 AM (3 days ago) Jun 30
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
INFO: task hung in bch2_fs_read_only_work

INFO: task kworker/1:2:785 blocked for more than 143 seconds.
Not tainted 6.10.0-rc5-syzkaller-00282-g8282d5af7be8-dirty #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/1:2 state:D stack:22896 pid:785 tgid:785 ppid:2 flags:0x00004000
Workqueue: events_long bch2_fs_read_only_work
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5408 [inline]
__schedule+0x1796/0x49d0 kernel/sched/core.c:6745
__schedule_loop kernel/sched/core.c:6822 [inline]
schedule+0x14b/0x320 kernel/sched/core.c:6837
schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6894
rwsem_down_write_slowpath+0xeeb/0x13b0 kernel/locking/rwsem.c:1178
__down_write_common+0x1af/0x200 kernel/locking/rwsem.c:1306
bch2_fs_read_only_work+0x25/0x40 fs/bcachefs/super.c:392
process_one_work kernel/workqueue.c:3248 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3329
worker_thread+0x86d/0xd50 kernel/workqueue.c:3409
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: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
#0: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
#0: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x55/0x2a0 kernel/locking/lockdep.c:6614
3 locks held by kworker/1:2/785:
#0: ffff888015081148 ((wq_completion)events_long){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3223 [inline]
#0: ffff888015081148 ((wq_completion)events_long){+.+.}-{0:0}, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3329
#1: ffffc900039efd00 ((work_completion)(&c->read_only_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3224 [inline]
#1: ffffc900039efd00 ((work_completion)(&c->read_only_work)){+.+.}-{0:0}, at: process_scheduled_works+0x945/0x1830 kernel/workqueue.c:3329
#2: ffff88806a980278 (&c->state_lock){+.+.}-{3:3}, at: bch2_fs_read_only_work+0x25/0x40 fs/bcachefs/super.c:392
2 locks held by getty/4831:
#0: ffff88802ab140a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
#1: ffffc90002f062f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6b5/0x1e10 drivers/tty/n_tty.c:2211
3 locks held by syz-executor/6022:
2 locks held by syz-executor/6591:

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

NMI backtrace for cpu 1
CPU: 1 PID: 30 Comm: khungtaskd Not tainted 6.10.0-rc5-syzkaller-00282-g8282d5af7be8-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
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:223 [inline]
watchdog+0xfde/0x1020 kernel/hung_task.c:379
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 PID: 6591 Comm: syz-executor Not tainted 6.10.0-rc5-syzkaller-00282-g8282d5af7be8-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
RIP: 0010:check_kcov_mode kernel/kcov.c:184 [inline]
RIP: 0010:write_comp_data kernel/kcov.c:236 [inline]
RIP: 0010:__sanitizer_cov_trace_const_cmp8+0x35/0x90 kernel/kcov.c:311
Code: 0c 25 c0 d4 03 00 65 8b 05 b0 a4 6d 7e a9 00 01 ff 00 74 10 a9 00 01 00 00 74 57 83 b9 1c 16 00 00 00 74 4e 8b 81 f8 15 00 00 <83> f8 03 75 43 48 8b 91 00 16 00 00 44 8b 89 fc 15 00 00 49 c1 e1
RSP: 0018:ffffc90002e9f758 EFLAGS: 00000246
RAX: 0000000000000000 RBX: 0000000000000002 RCX: ffff8880268c0000
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000002
RBP: dffffc0000000000 R08: ffffffff8b79786e R09: 1ffffffff25eeeb0
R10: dffffc0000000000 R11: fffffbfff25eeeb1 R12: ffffc90002e9f820
R13: 000000000000001f R14: ffff88806151c002 R15: ffff888067575fa8
FS: 00007f86375a56c0(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f86374e66e4 CR3: 000000007a3ee000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<NMI>
</NMI>
<TASK>
xa_is_internal include/linux/xarray.h:175 [inline]
xa_is_sibling include/linux/xarray.h:1287 [inline]
xas_descend lib/xarray.c:210 [inline]
xas_load+0x1fe/0x5c0 lib/xarray.c:245
filemap_get_entry+0x1fe/0x4e0 mm/filemap.c:1840
shmem_get_folio_gfp+0x2a8/0x1f50 mm/shmem.c:1982
shmem_get_folio mm/shmem.c:2160 [inline]
shmem_write_begin+0x170/0x4d0 mm/shmem.c:2743
generic_perform_write+0x322/0x640 mm/filemap.c:4015
shmem_file_write_iter+0xfc/0x120 mm/shmem.c:2919
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0xa72/0xc90 fs/read_write.c:590
ksys_write+0x1a0/0x2c0 fs/read_write.c:643
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f863687bcaf
Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 b9 80 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 0c 81 02 00 48
RSP: 002b:00007f86375a4e80 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000001000000 RCX: 00007f863687bcaf
RDX: 0000000001000000 RSI: 00007f862d600000 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000005b5b
R10: 0000000000000002 R11: 0000000000000293 R12: 0000000000000003
R13: 00007f86375a4f80 R14: 00007f86375a4f40 R15: 00007f862d600000
</TASK>


Tested on:

commit: 8282d5af Merge tag 'nfs-for-6.10-3' of git://git.linux..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=10f4ab3e980000
kernel config: https://syzkaller.appspot.com/x/.config?x=bf5def5af476d39a
dashboard link: https://syzkaller.appspot.com/bug?extid=8996d8f176cf946ef641
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=116a7f05980000

Lizhi Xu

unread,
Jul 1, 2024, 4:45:47 AM (2 days ago) Jul 1
to syzbot+8996d8...@syzkaller.appspotmail.com, syzkall...@googlegroups.com
#syz test: upstream f06ce441457d

when hit -BCH_ERR_fsck_errors_not_fixed in journal_entry_err, it will make
journal_entry_btree_keys_validate output too many same error log, and it will block
bch2_fs_start to release state_lock

diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c
index 492426c8d869..67c3f09162e4 100644
--- a/fs/bcachefs/journal_io.c
+++ b/fs/bcachefs/journal_io.c
@@ -415,6 +415,8 @@ static int journal_entry_btree_keys_validate(struct bch_fs *c,
flags|BCH_VALIDATE_journal);
if (ret == FSCK_DELETED_KEY)
continue;
+ else if (ret == -BCH_ERR_fsck_errors_not_fixed)
+ break;

k = bkey_next(k);
}

syzbot

unread,
Jul 1, 2024, 10:18:03 AM (2 days ago) Jul 1
to linux-...@vger.kernel.org, lizh...@windriver.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+8996d8...@syzkaller.appspotmail.com

Tested on:

commit: f06ce441 Merge tag 'loongarch-fixes-6.10-1' of git://g..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1183738e980000
kernel config: https://syzkaller.appspot.com/x/.config?x=eb72437243175f22
dashboard link: https://syzkaller.appspot.com/bug?extid=8996d8f176cf946ef641
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1306a869980000

Note: testing is done by a robot and is best-effort only.

Lizhi Xu

unread,
Jul 1, 2024, 10:36:11 AM (2 days ago) Jul 1
to syzbot+8996d8...@syzkaller.appspotmail.com, bfo...@redhat.com, kent.ov...@linux.dev, linux-b...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Error logs:
[ T5078] invalid journal entry, version=1.7: mi_btree_bitmap type=btree_keys in superblock: k->u64s 0, shutting down
[ T5078] invalid journal entry, version=1.7: mi_btree_bitmap type=btree_keys in superblock: k->u64s 0, shutting down
[ T5078] invalid journal entry, version=1.7: mi_btree_bitmap type=btree_keys in superblock: k->u64s 0, shutting down

When hit -BCH_ERR_fsck_errors_not_fixed in journal_entry_err, it will make
journal_entry_btree_keys_validate output too many same error log, and it will block
bch2_fs_start to release state_lock.

Reported-and-tested-by: syzbot+8996d8...@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=8996d8f176cf946ef641
Signed-off-by: Lizhi Xu <lizh...@windriver.com>
---
fs/bcachefs/journal_io.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c
index 492426c8d869..67c3f09162e4 100644
--- a/fs/bcachefs/journal_io.c
+++ b/fs/bcachefs/journal_io.c
@@ -415,6 +415,8 @@ static int journal_entry_btree_keys_validate(struct bch_fs *c,
flags|BCH_VALIDATE_journal);
if (ret == FSCK_DELETED_KEY)
continue;
+ else if (ret == -BCH_ERR_fsck_errors_not_fixed)
+ break;

k = bkey_next(k);
}
--
2.43.0

Reply all
Reply to author
Forward
0 new messages