loop0: detected capacity change from 0 to 32768 bcachefs (loop0): starting version 1.7: mi_btree_bitmap opts=errors=continue,metadata_checksum=none,data_checksum=none,compression=lz4,nocow allowing incompatible features above 0.0: (unknown version) features: lz4,new_siphash,inline_data,new_extent_overwrite,btree_ptr_v2,new_varint,journal_no_flush,alloc_v2,extents_across_btree_nodes bcachefs (loop0): Using encoding defined by superblock: utf8-12.1.0 bcachefs (loop0): initializing new filesystem bcachefs (loop0): going read-write bcachefs (loop0): marking superblocks bcachefs (loop0): initializing freespace bcachefs (loop0): done initializing freespace bcachefs (loop0): reading snapshots table bcachefs (loop0): reading snapshots done bcachefs (loop0): loop0: Superblock write was silently dropped! (seq 0 expected 42) bcachefs (loop0): done starting filesystem evm: overlay not supported ============================================ WARNING: possible recursive locking detected 6.16.0-syzkaller-12063-g37816488247d #0 Not tainted -------------------------------------------- syz.0.0/5356 is trying to acquire lock: ffff88805259c8e0 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff88805259c8e0 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: bch2_symlink+0xf2/0x240 fs/bcachefs/fs.c:881 but task is already holding lock: ffff88805259c148 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff88805259c148 (&sb->s_type->i_mutex_key#21){++++}-{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#21); lock(&sb->s_type->i_mutex_key#21); *** DEADLOCK *** May be due to missing lock nesting notation 5 locks held by syz.0.0/5356: #0: ffff888043ab8428 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:557 #1: ffff888052557570 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: inode_lock_killable include/linux/fs.h:874 [inline] #1: ffff888052557570 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: chown_common+0x313/0x5c0 fs/open.c:779 #2: ffff888052557928 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_inode_lock_interruptible fs/overlayfs/overlayfs.h:672 [inline] #2: ffff888052557928 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_copy_up_start+0x56/0x330 fs/overlayfs/util.c:737 #3: ffff8880369c8428 (sb_writers#12){.+.+}-{0:0}, at: ovl_copy_up_workdir fs/overlayfs/copy_up.c:781 [inline] #3: ffff8880369c8428 (sb_writers#12){.+.+}-{0:0}, at: ovl_do_copy_up fs/overlayfs/copy_up.c:1001 [inline] #3: ffff8880369c8428 (sb_writers#12){.+.+}-{0:0}, at: ovl_copy_up_one fs/overlayfs/copy_up.c:1202 [inline] #3: ffff8880369c8428 (sb_writers#12){.+.+}-{0:0}, at: ovl_copy_up_flags+0x1090/0x2fe0 fs/overlayfs/copy_up.c:1257 #4: ffff88805259c148 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #4: ffff88805259c148 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: ovl_create_temp+0x54/0xb0 fs/overlayfs/dir.c:228 stack backtrace: CPU: 0 UID: 0 PID: 5356 Comm: syz.0.0 Not tainted 6.16.0-syzkaller-12063-g37816488247d #0 PREEMPT(full) 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_lvl+0x189/0x250 lib/dump_stack.c:120 print_deadlock_bug+0x28b/0x2a0 kernel/locking/lockdep.c:3041 check_deadlock kernel/locking/lockdep.c:3093 [inline] validate_chain+0x1a3f/0x2140 kernel/locking/lockdep.c:3895 __lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5237 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 down_write+0x96/0x1f0 kernel/locking/rwsem.c:1590 inode_lock include/linux/fs.h:869 [inline] bch2_symlink+0xf2/0x240 fs/bcachefs/fs.c:881 vfs_symlink+0x143/0x2f0 fs/namei.c:4730 ovl_do_symlink+0x89/0xd0 fs/overlayfs/overlayfs.h:270 ovl_create_real+0x245/0x410 fs/overlayfs/dir.c:201 ovl_create_temp+0x70/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+0x10aa/0x2fe0 fs/overlayfs/copy_up.c:1257 ovl_xattr_set+0x316/0x4d0 fs/overlayfs/xattrs.c:56 __vfs_removexattr+0x42e/0x470 fs/xattr.c:518 cap_inode_killpriv+0x24/0x50 security/commoncap.c:355 security_inode_killpriv+0x93/0x290 security/security.c:2685 setattr_prepare+0x1f7/0xac0 fs/attr.c:219 ovl_setattr+0xad/0x550 fs/overlayfs/inode.c:30 notify_change+0xb33/0xe40 fs/attr.c:552 chown_common+0x40c/0x5c0 fs/open.c:791 do_fchownat+0x161/0x270 fs/open.c:822 __do_sys_lchown fs/open.c:847 [inline] __se_sys_lchown fs/open.c:845 [inline] __x64_sys_lchown+0x85/0xa0 fs/open.c:845 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb44038ebe9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb4411ef038 EFLAGS: 00000246 ORIG_RAX: 000000000000005e RAX: ffffffffffffffda RBX: 00007fb4405b5fa0 RCX: 00007fb44038ebe9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000000 RBP: 00007fb440411e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fb4405b6038 R14: 00007fb4405b5fa0 R15: 00007ffcd0724e28 syz.0.0 (5356) used greatest stack depth: 15976 bytes left