loop0: detected capacity change from 0 to 64 ============================================ WARNING: possible recursive locking detected 6.9.0-rc7-syzkaller-gfda5695d692c #0 Not tainted -------------------------------------------- syz-executor266/6241 is trying to acquire lock: ffff0000d80aa0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x148/0x1c8 but task is already holding lock: ffff0000d80aa0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x148/0x1c8 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&tree->tree_lock/1); lock(&tree->tree_lock/1); *** DEADLOCK *** May be due to missing lock nesting notation 5 locks held by syz-executor266/6241: #0: ffff0000d80ac420 (sb_writers#8){.+.+}-{0:0}, at: do_ftruncate+0x1e4/0x4cc fs/open.c:178 #1: ffff0000d7001628 (&sb->s_type->i_mutex_key#16){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline] #1: ffff0000d7001628 (&sb->s_type->i_mutex_key#16){+.+.}-{3:3}, at: do_truncate fs/open.c:63 [inline] #1: ffff0000d7001628 (&sb->s_type->i_mutex_key#16){+.+.}-{3:3}, at: do_ftruncate+0x3d0/0x4cc fs/open.c:181 #2: ffff0000d7001478 (&HFS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xe4/0x1130 fs/hfs/extent.c:397 #3: ffff0000d80aa0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x148/0x1c8 #4: ffff0000d70000f8 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xe4/0x1130 fs/hfs/extent.c:397 stack backtrace: CPU: 0 PID: 6241 Comm: syz-executor266 Not tainted 6.9.0-rc7-syzkaller-gfda5695d692c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:114 dump_stack+0x1c/0x28 lib/dump_stack.c:123 print_deadlock_bug+0x4e4/0x660 kernel/locking/lockdep.c:3012 check_deadlock kernel/locking/lockdep.c:3062 [inline] validate_chain kernel/locking/lockdep.c:3856 [inline] __lock_acquire+0x5fe4/0x763c kernel/locking/lockdep.c:5137 lock_acquire+0x248/0x73c kernel/locking/lockdep.c:5754 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 hfs_find_init+0x148/0x1c8 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_extend_file+0x270/0x1130 fs/hfs/extent.c:401 hfs_bmap_reserve+0xd0/0x3b4 fs/hfs/btree.c:234 __hfs_ext_write_extent+0x1a0/0x468 fs/hfs/extent.c:121 __hfs_ext_cache_extent+0x84/0x754 fs/hfs/extent.c:174 hfs_ext_read_extent fs/hfs/extent.c:202 [inline] hfs_extend_file+0x29c/0x1130 fs/hfs/extent.c:401 hfs_get_block+0x3b8/0x9e0 fs/hfs/extent.c:353 __block_write_begin_int+0x580/0x166c fs/buffer.c:2105 __block_write_begin fs/buffer.c:2154 [inline] block_write_begin fs/buffer.c:2213 [inline] cont_write_begin+0x79c/0xc40 fs/buffer.c:2567 hfs_write_begin+0x98/0xe4 fs/hfs/inode.c:53 cont_expand_zero fs/buffer.c:2494 [inline] cont_write_begin+0x2d8/0xc40 fs/buffer.c:2557 hfs_write_begin+0x98/0xe4 fs/hfs/inode.c:53 hfs_file_truncate+0x1a4/0xeb0 fs/hfs/extent.c:494 hfs_inode_setattr+0x3a0/0x558 fs/hfs/inode.c:652 notify_change+0x9d4/0xc84 fs/attr.c:497 do_truncate fs/open.c:65 [inline] do_ftruncate+0x3e4/0x4cc fs/open.c:181 do_sys_ftruncate fs/open.c:199 [inline] __do_sys_ftruncate fs/open.c:207 [inline] __se_sys_ftruncate fs/open.c:205 [inline] __arm64_sys_ftruncate+0x94/0xec fs/open.c:205 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598