bcachefs (loop5): reading snapshots table bcachefs (loop5): reading snapshots done bcachefs (loop5): done starting filesystem ============================================ WARNING: possible recursive locking detected 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #0 Not tainted -------------------------------------------- syz.5.78/7225 is trying to acquire lock: ffff0000f8dae400 (&sb->s_type->i_mutex_key#22){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff0000f8dae400 (&sb->s_type->i_mutex_key#22){++++}-{4:4}, at: bch2_symlink+0xbc/0x1cc fs/bcachefs/fs.c:881 but task is already holding lock: ffff0000f8dad4d0 (&sb->s_type->i_mutex_key#22){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff0000f8dad4d0 (&sb->s_type->i_mutex_key#22){++++}-{4:4}, at: ovl_create_temp+0x54/0xb0 fs/overlayfs/dir.c:228 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&sb->s_type->i_mutex_key#22); lock(&sb->s_type->i_mutex_key#22); *** DEADLOCK *** May be due to missing lock nesting notation 7 locks held by syz.5.78/7225: #0: ffff0000f963e428 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:557 #1: ffff0000f7763570 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:914 [inline] #1: ffff0000f7763570 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: lock_rename fs/namei.c:3272 [inline] #1: ffff0000f7763570 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: do_renameat2+0x364/0x8c8 fs/namei.c:5224 #2: ffff0000f7763b38 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #2: ffff0000f7763b38 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: lock_two_nondirectories+0xc4/0x150 fs/inode.c:1232 #3: ffff0000f7764100 (&ovl_i_mutex_key[depth]/4){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:914 [inline] #3: ffff0000f7764100 (&ovl_i_mutex_key[depth]/4){+.+.}-{4:4}, at: lock_two_nondirectories+0xf0/0x150 fs/inode.c:1234 #4: ffff0000f77644b8 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_inode_lock_interruptible fs/overlayfs/overlayfs.h:672 [inline] #4: ffff0000f77644b8 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_copy_up_start+0x58/0x2a8 fs/overlayfs/util.c:737 #5: ffff0000cf262428 (sb_writers#16){.+.+}-{0:0}, at: ovl_copy_up_workdir fs/overlayfs/copy_up.c:781 [inline] #5: ffff0000cf262428 (sb_writers#16){.+.+}-{0:0}, at: ovl_do_copy_up fs/overlayfs/copy_up.c:1001 [inline] #5: ffff0000cf262428 (sb_writers#16){.+.+}-{0:0}, at: ovl_copy_up_one fs/overlayfs/copy_up.c:1202 [inline] #5: ffff0000cf262428 (sb_writers#16){.+.+}-{0:0}, at: ovl_copy_up_flags+0xcd8/0x28a0 fs/overlayfs/copy_up.c:1257 #6: ffff0000f8dad4d0 (&sb->s_type->i_mutex_key#22){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #6: ffff0000f8dad4d0 (&sb->s_type->i_mutex_key#22){++++}-{4:4}, at: ovl_create_temp+0x54/0xb0 fs/overlayfs/dir.c:228 stack backtrace: CPU: 1 UID: 0 PID: 7225 Comm: syz.5.78 Not tainted 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_deadlock_bug+0x2e8/0x2f0 kernel/locking/lockdep.c:3041 check_deadlock kernel/locking/lockdep.c:3093 [inline] validate_chain kernel/locking/lockdep.c:3895 [inline] __lock_acquire+0x2940/0x30a4 kernel/locking/lockdep.c:5237 lock_acquire+0x14c/0x2e0 kernel/locking/lockdep.c:5868 down_write+0x50/0xc0 kernel/locking/rwsem.c:1590 inode_lock include/linux/fs.h:869 [inline] bch2_symlink+0xbc/0x1cc fs/bcachefs/fs.c:881 vfs_symlink+0x138/0x288 fs/namei.c:4730 ovl_do_symlink+0x94/0xe8 fs/overlayfs/overlayfs.h:270 ovl_create_real+0x240/0x3fc fs/overlayfs/dir.c:201 ovl_create_temp+0x74/0xb0 fs/overlayfs/dir.c:229 ovl_copy_up_workdir fs/overlayfs/copy_up.c:782 [inline] ovl_do_copy_up fs/overlayfs/copy_up.c:1001 [inline] ovl_copy_up_one fs/overlayfs/copy_up.c:1202 [inline] ovl_copy_up_flags+0xcec/0x28a0 fs/overlayfs/copy_up.c:1257 ovl_copy_up+0x24/0x34 fs/overlayfs/copy_up.c:1297 ovl_rename+0x628/0x1210 fs/overlayfs/dir.c:1145 vfs_rename+0x934/0xce0 fs/namei.c:5129 do_renameat2+0x614/0x8c8 fs/namei.c:5278 __do_sys_renameat2 fs/namei.c:5312 [inline] __se_sys_renameat2 fs/namei.c:5309 [inline] __arm64_sys_renameat2+0xd8/0xf4 fs/namei.c:5309 __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+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596