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 bcachefs (loop0): 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 ============================================ WARNING: possible recursive locking detected 6.15.0-rc1-syzkaller-00325-g7cdabafc0012 #0 Not tainted -------------------------------------------- syz.0.0/5323 is trying to acquire lock: ffff888055052740 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: inode_lock include/linux/fs.h:867 [inline] ffff888055052740 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: bch2_symlink+0x178/0x320 fs/bcachefs/fs.c:858 but task is already holding lock: ffff888055051078 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: inode_lock include/linux/fs.h:867 [inline] ffff888055051078 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_copy_up_workdir fs/overlayfs/copy_up.c:782 [inline] ffff888055051078 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_do_copy_up fs/overlayfs/copy_up.c:1001 [inline] ffff888055051078 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_copy_up_one fs/overlayfs/copy_up.c:1202 [inline] ffff888055051078 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_copy_up_flags+0x19d7/0x47f0 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 6 locks held by syz.0.0/5323: #0: ffff8880366fc420 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:556 #1: ffff88805504de50 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:902 [inline] #1: ffff88805504de50 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: lock_rename fs/namei.c:3230 [inline] #1: ffff88805504de50 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{4:4}, at: do_renameat2+0x633/0x1290 fs/namei.c:5181 #2: ffff88805504e9e0 (&ovl_i_mutex_key[depth]/4){+.+.}-{4:4}, at: vfs_rename+0x686/0xf10 fs/namei.c:5057 #3: ffff88805504ed98 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_inode_lock_interruptible fs/overlayfs/overlayfs.h:651 [inline] #3: ffff88805504ed98 (&ovl_i_lock_key[depth]){+.+.}-{4:4}, at: ovl_copy_up_start+0x53/0x310 fs/overlayfs/util.c:727 #4: ffff88803c33a420 (sb_writers#12){.+.+}-{0:0}, at: ovl_copy_up_workdir fs/overlayfs/copy_up.c:781 [inline] #4: ffff88803c33a420 (sb_writers#12){.+.+}-{0:0}, at: ovl_do_copy_up fs/overlayfs/copy_up.c:1001 [inline] #4: ffff88803c33a420 (sb_writers#12){.+.+}-{0:0}, at: ovl_copy_up_one fs/overlayfs/copy_up.c:1202 [inline] #4: ffff88803c33a420 (sb_writers#12){.+.+}-{0:0}, at: ovl_copy_up_flags+0x19c0/0x47f0 fs/overlayfs/copy_up.c:1257 #5: ffff888055051078 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: inode_lock include/linux/fs.h:867 [inline] #5: ffff888055051078 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_copy_up_workdir fs/overlayfs/copy_up.c:782 [inline] #5: ffff888055051078 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_do_copy_up fs/overlayfs/copy_up.c:1001 [inline] #5: ffff888055051078 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_copy_up_one fs/overlayfs/copy_up.c:1202 [inline] #5: ffff888055051078 (&sb->s_type->i_mutex_key#20){++++}-{4:4}, at: ovl_copy_up_flags+0x19d7/0x47f0 fs/overlayfs/copy_up.c:1257 stack backtrace: CPU: 0 UID: 0 PID: 5323 Comm: syz.0.0 Not tainted 6.15.0-rc1-syzkaller-00325-g7cdabafc0012 #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 lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x2be/0x2d0 kernel/locking/lockdep.c:3042 check_deadlock kernel/locking/lockdep.c:3094 [inline] validate_chain+0x928/0x24e0 kernel/locking/lockdep.c:3896 __lock_acquire+0xad5/0xd80 kernel/locking/lockdep.c:5235 lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 down_write+0x9c/0x220 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:867 [inline] bch2_symlink+0x178/0x320 fs/bcachefs/fs.c:858 vfs_symlink+0x137/0x2e0 fs/namei.c:4688 ovl_do_symlink+0x85/0xd0 fs/overlayfs/overlayfs.h:268 ovl_create_real+0x271/0x460 fs/overlayfs/dir.c:176 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+0x1a0a/0x47f0 fs/overlayfs/copy_up.c:1257 ovl_rename+0x62c/0x1760 fs/overlayfs/dir.c:1122 vfs_rename+0xbce/0xf10 fs/namei.c:5086 do_renameat2+0xc8d/0x1290 fs/namei.c:5235 __do_sys_renameat2 fs/namei.c:5269 [inline] __se_sys_renameat2 fs/namei.c:5266 [inline] __x64_sys_renameat2+0xce/0xe0 fs/namei.c:5266 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f37b438d169 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:00007f37b5274038 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 00007f37b45a5fa0 RCX: 00007f37b438d169 RDX: ffffffffffffff9c RSI: 0000200000000580 RDI: ffffffffffffff9c RBP: 00007f37b440e990 R08: 0000000000000000 R09: 0000000000000000 R10: 00002000000005c0 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f37b45a5fa0 R15: 00007fffad9e6418 syz.0.0 (5323) used greatest stack depth: 10568 bytes left