============================================ WARNING: possible recursive locking detected 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #0 Not tainted -------------------------------------------- syz.3.367/8229 is trying to acquire lock: ffff0000f59ae400 (&sb->s_type->i_mutex_key#25){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff0000f59ae400 (&sb->s_type->i_mutex_key#25){++++}-{4:4}, at: bch2_symlink+0xbc/0x1cc fs/bcachefs/fs.c:881 but task is already holding lock: ffff0000f59adc68 (&sb->s_type->i_mutex_key#25){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff0000f59adc68 (&sb->s_type->i_mutex_key#25){++++}-{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#25); lock(&sb->s_type->i_mutex_key#25); *** DEADLOCK *** May be due to missing lock nesting notation 6 locks held by syz.3.367/8229: #0: ffff0000de722428 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:557 #1: ffff0000f593afa8 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:914 [inline] #1: ffff0000f593afa8 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: filename_create+0x1ac/0x32c fs/namei.c:4139 #2: ffff0000f593b570 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #2: ffff0000f593b570 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: vfs_link+0x2f0/0x590 fs/namei.c:4845 #3: ffff0000f593b928 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_inode_lock_interruptible fs/overlayfs/overlayfs.h:672 [inline] #3: ffff0000f593b928 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_copy_up_start+0x58/0x2a8 fs/overlayfs/util.c:737 #4: ffff0000d1a78428 (sb_writers#17){.+.+}-{0:0}, at: ovl_copy_up_workdir fs/overlayfs/copy_up.c:781 [inline] #4: ffff0000d1a78428 (sb_writers#17){.+.+}-{0:0}, at: ovl_do_copy_up fs/overlayfs/copy_up.c:1001 [inline] #4: ffff0000d1a78428 (sb_writers#17){.+.+}-{0:0}, at: ovl_copy_up_one fs/overlayfs/copy_up.c:1202 [inline] #4: ffff0000d1a78428 (sb_writers#17){.+.+}-{0:0}, at: ovl_copy_up_flags+0xcd8/0x28a0 fs/overlayfs/copy_up.c:1257 #5: ffff0000f59adc68 (&sb->s_type->i_mutex_key#25){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #5: ffff0000f59adc68 (&sb->s_type->i_mutex_key#25){++++}-{4:4}, at: ovl_create_temp+0x54/0xb0 fs/overlayfs/dir.c:228 stack backtrace: CPU: 1 UID: 0 PID: 8229 Comm: syz.3.367 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_link+0x8c/0x258 fs/overlayfs/dir.c:725 vfs_link+0x3e0/0x590 fs/namei.c:4854 do_linkat+0x224/0x48c fs/namei.c:4924 __do_sys_linkat fs/namei.c:4952 [inline] __se_sys_linkat fs/namei.c:4949 [inline] __arm64_sys_linkat+0xdc/0xf8 fs/namei.c:4949 __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