bcachefs (loop0): bucket_gens_init... bcachefs (loop0): journal_entry_open(): fatal error cannot start: journal seq overflow ============================================ WARNING: possible recursive locking detected 6.13.0-syzkaller-02526-gc4b9570cfb63 #0 Not tainted -------------------------------------------- syz-executor290/5302 is trying to acquire lock: ffff888044d4a980 (&j->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff888044d4a980 (&j->lock){+.+.}-{3:3}, at: bch2_journal_halt+0x2f/0x110 fs/bcachefs/journal.c:315 but task is already holding lock: ffff888044d4a980 (&j->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff888044d4a980 (&j->lock){+.+.}-{3:3}, at: __journal_res_get+0x497/0x26b0 fs/bcachefs/journal.c:533 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&j->lock); lock(&j->lock); *** DEADLOCK *** May be due to missing lock nesting notation 4 locks held by syz-executor290/5302: #0: ffff888044d00278 (&c->state_lock){+.+.}-{4:4}, at: bch2_fs_start+0x45/0x610 fs/bcachefs/super.c:999 #1: ffff888044d04378 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:164 [inline] #1: ffff888044d04378 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:256 [inline] #1: ffff888044d04378 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7e4/0xd30 fs/bcachefs/btree_iter.c:3378 #2: ffff8880411f0140 (bcachefs_btree){+.+.}-{0:0}, at: trans_set_locked fs/bcachefs/btree_locking.h:198 [inline] #2: ffff8880411f0140 (bcachefs_btree){+.+.}-{0:0}, at: bch2_trans_begin+0x9ca/0x1d90 fs/bcachefs/btree_iter.c:3275 #3: ffff888044d4a980 (&j->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] #3: ffff888044d4a980 (&j->lock){+.+.}-{3:3}, at: __journal_res_get+0x497/0x26b0 fs/bcachefs/journal.c:533 stack backtrace: CPU: 0 UID: 0 PID: 5302 Comm: syz-executor290 Not tainted 6.13.0-syzkaller-02526-gc4b9570cfb63 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3039 check_deadlock kernel/locking/lockdep.c:3091 [inline] validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3893 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] bch2_journal_halt+0x2f/0x110 fs/bcachefs/journal.c:315 bch2_fs_emergency_read_only+0x50/0xc0 fs/bcachefs/super.c:407 bch2_fatal_error+0x15/0x40 fs/bcachefs/error.c:49 journal_entry_open fs/bcachefs/journal.c:385 [inline] __journal_res_get+0xbef/0x26b0 fs/bcachefs/journal.c:557 bch2_journal_res_get_slowpath+0xe6/0x710 fs/bcachefs/journal.c:619 bch2_journal_res_get fs/bcachefs/journal.h:383 [inline] bch2_trans_journal_res_get fs/bcachefs/btree_trans_commit.c:350 [inline] bch2_trans_commit_write_locked fs/bcachefs/btree_trans_commit.c:652 [inline] do_bch2_trans_commit fs/bcachefs/btree_trans_commit.c:866 [inline] __bch2_trans_commit+0x353c/0x97a0 fs/bcachefs/btree_trans_commit.c:1066 bch2_trans_commit fs/bcachefs/btree_update.h:183 [inline] bch2_bucket_gens_init+0xd00/0x1080 fs/bcachefs/alloc_background.c:580 bch2_run_recovery_pass+0xf0/0x1e0 fs/bcachefs/recovery_passes.c:226 bch2_run_recovery_passes+0x2ad/0xa90 fs/bcachefs/recovery_passes.c:291 bch2_fs_recovery+0x265a/0x3de0 fs/bcachefs/recovery.c:937 bch2_fs_start+0x37c/0x610 fs/bcachefs/super.c:1030 bch2_fs_get_tree+0xd8d/0x1740 fs/bcachefs/fs.c:2203 vfs_get_tree+0x90/0x2b0 fs/super.c:1814 do_new_mount+0x2be/0xb40 fs/namespace.c:3560 do_mount fs/namespace.c:3900 [inline] __do_sys_mount fs/namespace.c:4111 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:4088 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:0x7f1cf368bdea Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fff3d007968 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fff3d007980 RCX: 00007f1cf368bdea RDX: 00000000200000c0 RSI: 0000000020000180 RDI: 00007fff3d007980 RBP: 0000000000000004 R08: 00007fff3d0079c0 R09: 0000000000005995 R10: 0000000000000000 R11: 0000000000000282 R12: 0000000000000000 R13: 00007fff3d0079c0 R14: 0000000000000003 R15: 0000000001000000