loop0: detected capacity change from 0 to 32768 bcachefs (da441363-bb6a-4ab9-999b-c1f40db4fee2): starting version 1.7: mi_btree_bitmap opts=errors=continue,metadata_checksum=none,data_checksum=none,compression=lz4,journal_flush_delay=2013266920,journal_reclaim_delay=10,nojournal_transaction_names 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 with devices loop0 bcachefs (da441363-bb6a-4ab9-999b-c1f40db4fee2): Using encoding defined by superblock: utf8-12.1.0 bcachefs (da441363-bb6a-4ab9-999b-c1f40db4fee2): initializing new filesystem bcachefs (da441363-bb6a-4ab9-999b-c1f40db4fee2): going read-write bcachefs (da441363-bb6a-4ab9-999b-c1f40db4fee2): marking superblocks bcachefs (da441363-bb6a-4ab9-999b-c1f40db4fee2): initializing freespace bcachefs (da441363-bb6a-4ab9-999b-c1f40db4fee2): done initializing freespace bcachefs (da441363-bb6a-4ab9-999b-c1f40db4fee2): reading snapshots table bcachefs (da441363-bb6a-4ab9-999b-c1f40db4fee2): reading snapshots done bcachefs (da441363-bb6a-4ab9-999b-c1f40db4fee2): done starting filesystem evm: overlay not supported ============================================ WARNING: possible recursive locking detected 6.16.0-syzkaller-11579-g35a813e010b9 #0 Not tainted -------------------------------------------- syz.0.0/5363 is trying to acquire lock: ffff8880526108e0 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff8880526108e0 (&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: ffff888052610148 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff888052610148 (&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/5363: #0: ffff888031768428 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:557 #1: ffff88805260e418 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: inode_lock_killable include/linux/fs.h:874 [inline] #1: ffff88805260e418 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: chown_common+0x313/0x5c0 fs/open.c:779 #2: ffff88805260e7d0 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_inode_lock_interruptible fs/overlayfs/overlayfs.h:672 [inline] #2: ffff88805260e7d0 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_copy_up_start+0x56/0x330 fs/overlayfs/util.c:737 #3: ffff888031376428 (sb_writers#12){.+.+}-{0:0}, at: ovl_copy_up_workdir fs/overlayfs/copy_up.c:781 [inline] #3: ffff888031376428 (sb_writers#12){.+.+}-{0:0}, at: ovl_do_copy_up fs/overlayfs/copy_up.c:1001 [inline] #3: ffff888031376428 (sb_writers#12){.+.+}-{0:0}, at: ovl_copy_up_one fs/overlayfs/copy_up.c:1202 [inline] #3: ffff888031376428 (sb_writers#12){.+.+}-{0:0}, at: ovl_copy_up_flags+0x1090/0x2fe0 fs/overlayfs/copy_up.c:1257 #4: ffff888052610148 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #4: ffff888052610148 (&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: 5363 Comm: syz.0.0 Not tainted 6.16.0-syzkaller-11579-g35a813e010b9 #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+0x140/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_setattr+0x10b/0x550 fs/overlayfs/inode.c:40 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:0x7f620238eb69 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:00007f62031b5038 EFLAGS: 00000246 ORIG_RAX: 000000000000005e RAX: ffffffffffffffda RBX: 00007f62025b5fa0 RCX: 00007f620238eb69 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000000 RBP: 00007f6202411df1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f62025b5fa0 R15: 00007fff806db4c8 overlayfs: failed lookup in lower (/, name='bus', err=-40): overlapping layers syz.0.0 (5363) used greatest stack depth: 15608 bytes left