loop0: detected capacity change from 0 to 64 ============================================ WARNING: possible recursive locking detected 6.11.0-rc5-syzkaller-gdf54f4a16f82 #0 Not tainted -------------------------------------------- syz-executor108/6388 is trying to acquire lock: ffff0000d89ce0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x148/0x1c8 but task is already holding lock: ffff0000d89ce0b0 (&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-executor108/6388: #0: ffff0000d89cc420 (sb_writers#8){.+.+}-{0:0}, at: do_ftruncate+0x1e4/0x4cc fs/open.c:178 #1: ffff0000d8511620 (&sb->s_type->i_mutex_key#16){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:799 [inline] #1: ffff0000d8511620 (&sb->s_type->i_mutex_key#16){+.+.}-{3:3}, at: do_truncate fs/open.c:63 [inline] #1: ffff0000d8511620 (&sb->s_type->i_mutex_key#16){+.+.}-{3:3}, at: do_ftruncate+0x3d0/0x4cc fs/open.c:181 #2: ffff0000d8511478 (&HFS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xe4/0x1130 fs/hfs/extent.c:397 #3: ffff0000d89ce0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x148/0x1c8 #4: ffff0000d85100f8 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xe4/0x1130 fs/hfs/extent.c:397 stack backtrace: CPU: 1 UID: 0 PID: 6388 Comm: syz-executor108 Not tainted 6.11.0-rc5-syzkaller-gdf54f4a16f82 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/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:93 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:119 dump_stack+0x1c/0x28 lib/dump_stack.c:128 print_deadlock_bug+0x4e4/0x660 kernel/locking/lockdep.c:3011 check_deadlock kernel/locking/lockdep.c:3061 [inline] validate_chain kernel/locking/lockdep.c:3855 [inline] __lock_acquire+0x6160/0x779c kernel/locking/lockdep.c:5142 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5759 __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:2125 __block_write_begin fs/buffer.c:2174 [inline] block_write_begin fs/buffer.c:2235 [inline] cont_write_begin+0x79c/0xc40 fs/buffer.c:2587 hfs_write_begin+0x98/0xe4 fs/hfs/inode.c:53 cont_expand_zero fs/buffer.c:2514 [inline] cont_write_begin+0x2d8/0xc40 fs/buffer.c:2577 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:655 notify_change+0x9d4/0xc84 fs/attr.c:495 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:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 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