bcachefs (loop0): starting version 1.7: mi_btree_bitmap opts=metadata_checksum=none,data_checksum=none,compression=lz4,nojournal_transaction_names ============================================ WARNING: possible recursive locking detected 6.12.0-rc3-syzkaller-gd2b1b3bccef6 #0 Not tainted -------------------------------------------- syz.0.15/7304 is trying to acquire lock: ffff0000e3a00908 (&c->sb_lock){+.+.}-{3:3}, at: bch2_replicas_entry_validate+0x34/0x88 fs/bcachefs/replicas.c:101 but task is already holding lock: ffff0000e3a00908 (&c->sb_lock){+.+.}-{3:3}, at: bch2_read_superblock_clean+0x44/0x444 fs/bcachefs/sb-clean.c:149 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&c->sb_lock); lock(&c->sb_lock); *** DEADLOCK *** May be due to missing lock nesting notation 2 locks held by syz.0.15/7304: #0: ffff0000e3a00278 (&c->state_lock){+.+.}-{3:3}, at: bch2_fs_start+0x50/0x53c fs/bcachefs/super.c:1007 #1: ffff0000e3a00908 (&c->sb_lock){+.+.}-{3:3}, at: bch2_read_superblock_clean+0x44/0x444 fs/bcachefs/sb-clean.c:149 stack backtrace: CPU: 1 UID: 0 PID: 7304 Comm: syz.0.15 Not tainted 6.12.0-rc3-syzkaller-gd2b1b3bccef6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:319 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:326 __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_deadlock_bug+0x4e8/0x668 kernel/locking/lockdep.c:3037 check_deadlock kernel/locking/lockdep.c:3089 [inline] validate_chain kernel/locking/lockdep.c:3891 [inline] __lock_acquire+0x6180/0x77c8 kernel/locking/lockdep.c:5202 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5825 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 bch2_replicas_entry_validate+0x34/0x88 fs/bcachefs/replicas.c:101 journal_entry_data_usage_validate+0x268/0x5ac fs/bcachefs/journal_io.c:608 bch2_journal_entry_validate+0xb8/0xec fs/bcachefs/journal_io.c:830 bch2_sb_clean_validate_late fs/bcachefs/sb-clean.c:40 [inline] bch2_read_superblock_clean+0x1ac/0x444 fs/bcachefs/sb-clean.c:168 bch2_fs_recovery+0x1b8/0x55a0 fs/bcachefs/recovery.c:639 bch2_fs_start+0x30c/0x53c fs/bcachefs/super.c:1037 bch2_fs_get_tree+0x938/0x1030 fs/bcachefs/fs.c:2078 vfs_get_tree+0x90/0x28c fs/super.c:1800 do_new_mount+0x278/0x900 fs/namespace.c:3507 path_mount+0x590/0xe04 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4055 [inline] __se_sys_mount fs/namespace.c:4032 [inline] __arm64_sys_mount+0x45c/0x5a8 fs/namespace.c:4032 __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+0x190/0x194 arch/arm64/kernel/entry.S:598