============================================ WARNING: possible recursive locking detected 5.15.182-syzkaller #0 Not tainted -------------------------------------------- syz.4.196/4841 is trying to acquire lock: ffff0000c906a0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x148/0x1c8 fs/hfs/bfind.c:-1 but task is already holding lock: ffff0000c906a0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x148/0x1c8 fs/hfs/bfind.c:-1 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.4.196/4841: #0: ffff0000c1666460 (sb_writers#12){.+.+}-{0:0}, at: do_sys_ftruncate+0x210/0x31c fs/open.c:190 #1: ffff0000dbf2bd28 (&sb->s_type->i_mutex_key#20){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #1: ffff0000dbf2bd28 (&sb->s_type->i_mutex_key#20){+.+.}-{3:3}, at: do_truncate+0x164/0x1f0 fs/open.c:63 #2: ffff0000dbf2bb78 (&HFS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xd8/0x1000 fs/hfs/extent.c:397 #3: ffff0000c906a0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x148/0x1c8 fs/hfs/bfind.c:-1 #4: ffff0000d61bcef8 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xd8/0x1000 fs/hfs/extent.c:397 stack backtrace: CPU: 1 PID: 4841 Comm: syz.4.196 Not tainted 5.15.182-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025 Call trace: dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 __lock_acquire+0x18a4/0x651c kernel/locking/lockdep.c:-1 lock_acquire+0x1f4/0x620 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x194/0x1edc kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0xac/0x11c kernel/locking/mutex.c:743 hfs_find_init+0x148/0x1c8 fs/hfs/bfind.c:-1 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_extend_file+0x250/0x1000 fs/hfs/extent.c:401 hfs_bmap_reserve+0xd4/0x3e0 fs/hfs/btree.c:231 __hfs_ext_write_extent+0x19c/0x488 fs/hfs/extent.c:121 __hfs_ext_cache_extent+0x84/0x750 fs/hfs/extent.c:174 hfs_ext_read_extent fs/hfs/extent.c:202 [inline] hfs_extend_file+0x27c/0x1000 fs/hfs/extent.c:401 hfs_get_block+0x2e8/0x9ec fs/hfs/extent.c:353 __block_write_begin_int+0x3e4/0x1588 fs/buffer.c:2012 __block_write_begin fs/buffer.c:2062 [inline] block_write_begin fs/buffer.c:2122 [inline] cont_write_begin+0x4e4/0x6dc fs/buffer.c:2471 hfs_write_begin+0xa8/0xf8 fs/hfs/inode.c:59 pagecache_write_begin+0xa0/0xc0 mm/filemap.c:3608 cont_expand_zero fs/buffer.c:2398 [inline] cont_write_begin+0x220/0x6dc fs/buffer.c:2461 hfs_write_begin+0xa8/0xf8 fs/hfs/inode.c:59 pagecache_write_begin+0xa0/0xc0 mm/filemap.c:3608 hfs_file_truncate+0x15c/0x7f0 fs/hfs/extent.c:494 hfs_inode_setattr+0x3a0/0x5bc fs/hfs/inode.c:657 notify_change+0xa08/0xcd8 fs/attr.c:505 do_truncate+0x178/0x1f0 fs/open.c:65 do_sys_ftruncate+0x284/0x31c fs/open.c:193 __do_sys_ftruncate fs/open.c:204 [inline] __se_sys_ftruncate fs/open.c:202 [inline] __arm64_sys_ftruncate+0x60/0x74 fs/open.c:202 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584