snapshot points to missing/incorrect tree: u64s 8 type snapshot 0:4294967295:0 len 0 ver 0: is_subvol 1 deleted 0 parent 0 children 0 0 subvol 1 tree 0, fixing done bcachefs (loop0): check_subvols... done bcachefs (loop0): check_subvol_children... done bcachefs (loop0): delete_dead_snapshots... done bcachefs (loop0): check_inodes... done bcachefs (loop0): check_extents... done bcachefs (loop0): check_indirect_extents... done bcachefs (loop0): check_dirents... done bcachefs (loop0): check_xattrs... done bcachefs (loop0): check_root... done bcachefs (loop0): check_unreachable_inodes... done bcachefs (loop0): check_subvolume_structure... done bcachefs (loop0): check_directory_structure... done bcachefs (loop0): check_nlinks... done bcachefs (loop0): resume_logged_ops... done bcachefs (loop0): delete_dead_inodes... done bcachefs (loop0): set_fs_needs_rebalance... done bcachefs (loop0): Fixed errors, running fsck a second time to verify fs is clean bcachefs (loop0): check_alloc_info... done bcachefs (loop0): check_lrus... done bcachefs (loop0): check_btree_backpointers... done bcachefs (loop0): check_backpointers_to_extents... done bcachefs (loop0): check_extents_to_backpointers... bcachefs (loop0): scanning for missing backpointers in 1/128 buckets done bcachefs (loop0): check_alloc_to_lru_refs... done bcachefs (loop0): bucket_gens_init... done bcachefs (loop0): check_snapshot_trees... done bcachefs (loop0): check_snapshots... done bcachefs (loop0): check_subvols... done bcachefs (loop0): check_subvol_children... done bcachefs (loop0): delete_dead_snapshots... done bcachefs (loop0): check_inodes... done bcachefs (loop0): check_extents... done bcachefs (loop0): check_indirect_extents... done bcachefs (loop0): check_dirents... done bcachefs (loop0): check_xattrs... done bcachefs (loop0): check_root... done bcachefs (loop0): check_unreachable_inodes... done bcachefs (loop0): check_subvolume_structure... done bcachefs (loop0): check_directory_structure... done bcachefs (loop0): check_nlinks... done bcachefs (loop0): resume_logged_ops... done bcachefs (loop0): delete_dead_inodes... done bcachefs (loop0): set_fs_needs_rebalance... done bcachefs (loop0): done starting filesystem loop0: detected capacity change from 32768 to 64 ============================================ WARNING: possible recursive locking detected 6.14.0-rc1-syzkaller-00187-g8f6629c004b1 #0 Not tainted -------------------------------------------- syz.0.0/5324 is trying to acquire lock: ffff888054b62ed8 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline] ffff888054b62ed8 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: bch2_symlink+0x176/0x310 fs/bcachefs/fs.c:839 but task is already holding lock: ffff888054b61810 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline] ffff888054b61810 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_copy_up_workdir fs/overlayfs/copy_up.c:782 [inline] ffff888054b61810 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_do_copy_up fs/overlayfs/copy_up.c:1001 [inline] ffff888054b61810 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_copy_up_one fs/overlayfs/copy_up.c:1202 [inline] ffff888054b61810 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_copy_up_flags+0x19cb/0x47c0 fs/overlayfs/copy_up.c:1257 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&sb->s_type->i_mutex_key#20); lock(&sb->s_type->i_mutex_key#20); *** DEADLOCK *** May be due to missing lock nesting notation 7 locks held by syz.0.0/5324: #0: ffff88804d48e420 (sb_writers#14){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:547 #1: ffff888043e25e50 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:912 [inline] #1: ffff888043e25e50 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: lock_rename fs/namei.c:3217 [inline] #1: ffff888043e25e50 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: do_renameat2+0x62c/0x13f0 fs/namei.c:5161 #2: ffff888043e269e0 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline] #2: ffff888043e269e0 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}, at: lock_two_nondirectories+0xe1/0x170 fs/inode.c:1281 #3: ffff888043e26fa8 (&ovl_i_mutex_key[depth]/4){+.+.}-{4:4}, at: vfs_rename+0x6a2/0xf00 fs/namei.c:5040 #4: ffff888043e26d98 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_inode_lock_interruptible fs/overlayfs/overlayfs.h:650 [inline] #4: ffff888043e26d98 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_copy_up_start+0x53/0x310 fs/overlayfs/util.c:727 #5: ffff888033e3e420 (sb_writers#13){.+.+}-{0:0}, at: ovl_copy_up_workdir fs/overlayfs/copy_up.c:781 [inline] #5: ffff888033e3e420 (sb_writers#13){.+.+}-{0:0}, at: ovl_do_copy_up fs/overlayfs/copy_up.c:1001 [inline] #5: ffff888033e3e420 (sb_writers#13){.+.+}-{0:0}, at: ovl_copy_up_one fs/overlayfs/copy_up.c:1202 [inline] #5: ffff888033e3e420 (sb_writers#13){.+.+}-{0:0}, at: ovl_copy_up_flags+0x19b4/0x47c0 fs/overlayfs/copy_up.c:1257 #6: ffff888054b61810 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline] #6: ffff888054b61810 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_copy_up_workdir fs/overlayfs/copy_up.c:782 [inline] #6: ffff888054b61810 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_do_copy_up fs/overlayfs/copy_up.c:1001 [inline] #6: ffff888054b61810 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_copy_up_one fs/overlayfs/copy_up.c:1202 [inline] #6: ffff888054b61810 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_copy_up_flags+0x19cb/0x47c0 fs/overlayfs/copy_up.c:1257 stack backtrace: CPU: 0 UID: 0 PID: 5324 Comm: syz.0.0 Not tainted 6.14.0-rc1-syzkaller-00187-g8f6629c004b1 #0 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 lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3039 check_deadlock kernel/locking/lockdep.c:3091 [inline] validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3893 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 down_write+0x99/0x220 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:877 [inline] bch2_symlink+0x176/0x310 fs/bcachefs/fs.c:839 vfs_symlink+0x137/0x2e0 fs/namei.c:4671 ovl_do_symlink+0x85/0xd0 fs/overlayfs/overlayfs.h:267 ovl_create_real+0x346/0x550 fs/overlayfs/dir.c:206 ovl_copy_up_workdir fs/overlayfs/copy_up.c:783 [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+0x19fe/0x47c0 fs/overlayfs/copy_up.c:1257 ovl_rename+0x62a/0x1760 fs/overlayfs/dir.c:1150 vfs_rename+0xbdb/0xf00 fs/namei.c:5069 do_renameat2+0xd94/0x13f0 fs/namei.c:5226 __do_sys_renameat2 fs/namei.c:5260 [inline] __se_sys_renameat2 fs/namei.c:5257 [inline] __x64_sys_renameat2+0xce/0xe0 fs/namei.c:5257 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fd6b698cde9 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:00007fd6b7774038 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 00007fd6b6ba5fa0 RCX: 00007fd6b698cde9 RDX: 0000000000000009 RSI: 0000400000000180 RDI: 0000000000000009 RBP: 00007fd6b6a0e2a0 R08: 0000000000000002 R09: 0000000000000000 R10: 00004000000001c0 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fd6b6ba5fa0 R15: 00007ffdf03a00b8 syz.0.0 (5324) used greatest stack depth: 8304 bytes left