journal_seq_nonempty 15 journal_seq_empty 0 need_discard 1 need_inc_gen 1 dirty_sectors 0 stripe_sectors 0 cached_sectors 0 stripe 0 stripe_redundancy 0 io_time[READ] 1 io_time[WRITE] 896 fragmentation 0 bp_start 8 , fixing bcachefs (loop0): bucket incorrectly unset in need_discard btree u64s 13 type alloc_v4 0:173:0 len 0 ver 0: gen 0 oldest_gen 0 data_type need_discard journal_seq_nonempty 15 journal_seq_empty 0 need_discard 1 need_inc_gen 1 dirty_sectors 0 stripe_sectors 0 cached_sectors 0 stripe 0 stripe_redundancy 0 io_time[READ] 1 io_time[WRITE] 896 fragmentation 0 bp_start 8 , fixing bcachefs (loop0): hole in alloc btree missing in freespace btree device 0 buckets 174-175, fixing bcachefs (loop0): hole in alloc btree missing in freespace btree device 0 buckets 182-183, fixing bcachefs (loop0): hole in alloc btree missing in freespace btree device 0 buckets 191-448, fixing done bcachefs (loop0): check_lrus... done bcachefs (loop0): check_backpointers_to_extents... done bcachefs (loop0): check_extents_to_backpointers... bcachefs (loop0): scanning for missing backpointers in 2/512 buckets done bcachefs (loop0): check_inodes... done bcachefs (loop0): resume_logged_ops... done bcachefs (loop0): delete_dead_inodes... done bcachefs (loop0): done starting filesystem netlink: 36 bytes leftover after parsing attributes in process `syz.0.0'. tipc: Enabling of bearer rejected, media not registered ============================================ WARNING: possible recursive locking detected 6.16.0-syzkaller-11952-g6e64f4580381 #0 Not tainted -------------------------------------------- syz.0.0/5357 is trying to acquire lock: ffff88804495d810 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff88804495d810 (&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: ffff88804495c8e0 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff88804495c8e0 (&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 6 locks held by syz.0.0/5357: #0: ffff888036464428 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:557 #1: ffff888044961e50 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:914 [inline] #1: ffff888044961e50 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: filename_create+0x1f8/0x3c0 fs/namei.c:4139 #2: ffff888044962418 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #2: ffff888044962418 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: vfs_link+0x3b4/0x6e0 fs/namei.c:4845 #3: ffff8880449627d0 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_inode_lock_interruptible fs/overlayfs/overlayfs.h:672 [inline] #3: ffff8880449627d0 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_copy_up_start+0x56/0x330 fs/overlayfs/util.c:737 #4: ffff888041d5e428 (sb_writers#12){.+.+}-{0:0}, at: ovl_copy_up_workdir fs/overlayfs/copy_up.c:781 [inline] #4: ffff888041d5e428 (sb_writers#12){.+.+}-{0:0}, at: ovl_do_copy_up fs/overlayfs/copy_up.c:1001 [inline] #4: ffff888041d5e428 (sb_writers#12){.+.+}-{0:0}, at: ovl_copy_up_one fs/overlayfs/copy_up.c:1202 [inline] #4: ffff888041d5e428 (sb_writers#12){.+.+}-{0:0}, at: ovl_copy_up_flags+0x1090/0x2fe0 fs/overlayfs/copy_up.c:1257 #5: ffff88804495c8e0 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #5: ffff88804495c8e0 (&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: 5357 Comm: syz.0.0 Not tainted 6.16.0-syzkaller-11952-g6e64f4580381 #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_link+0x85/0x270 fs/overlayfs/dir.c:725 vfs_link+0x4ea/0x6e0 fs/namei.c:4854 do_linkat+0x272/0x560 fs/namei.c:4924 __do_sys_link fs/namei.c:4958 [inline] __se_sys_link fs/namei.c:4956 [inline] __x64_sys_link+0x82/0x90 fs/namei.c:4956 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:0x7f80ad18ebe9 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:00007f80adfed038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007f80ad3b5fa0 RCX: 00007f80ad18ebe9 RDX: 0000000000000000 RSI: 0000200000000300 RDI: 0000200000000200 RBP: 00007f80ad211e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f80ad3b6038 R14: 00007f80ad3b5fa0 R15: 00007fff22343778 syz.0.0 (5357) used greatest stack depth: 13464 bytes left