============================================ WARNING: possible recursive locking detected 5.15.185-syzkaller #0 Not tainted -------------------------------------------- syz.5.490/6101 is trying to acquire lock: ffff0000da34e0b0 (&tree->tree_lock#2/1){+.+.}-{3:3}, at: hfs_find_init+0x148/0x1c8 fs/hfs/bfind.c:-1 but task is already holding lock: ffff0000da34e0b0 (&tree->tree_lock#2/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#2/1); lock(&tree->tree_lock#2/1); *** DEADLOCK *** May be due to missing lock nesting notation 5 locks held by syz.5.490/6101: #0: ffff0000ee742460 (sb_writers#25){.+.+}-{0:0}, at: vfs_writev fs/read_write.c:927 [inline] #0: ffff0000ee742460 (sb_writers#25){.+.+}-{0:0}, at: do_pwritev+0x1b4/0x2fc fs/read_write.c:1025 #1: ffff0000ee729628 (&sb->s_type->i_mutex_key#31){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #1: ffff0000ee729628 (&sb->s_type->i_mutex_key#31){+.+.}-{3:3}, at: generic_file_write_iter+0x80/0x1b4 mm/filemap.c:3941 #2: ffff0000ee729478 (&HFS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xd8/0x1000 fs/hfs/extent.c:397 #3: ffff0000da34e0b0 (&tree->tree_lock#2/1){+.+.}-{3:3}, at: hfs_find_init+0x148/0x1c8 fs/hfs/bfind.c:-1 #4: ffff0000ee7280f8 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xd8/0x1000 fs/hfs/extent.c:397 stack backtrace: CPU: 1 PID: 6101 Comm: syz.5.490 Not tainted 5.15.185-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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 generic_perform_write+0x204/0x480 mm/filemap.c:3785 __generic_file_write_iter+0x23c/0x454 mm/filemap.c:3912 generic_file_write_iter+0xb0/0x1b4 mm/filemap.c:3944 do_iter_readv_writev+0x3a0/0x4f8 fs/read_write.c:-1 do_iter_write+0x1c4/0x670 fs/read_write.c:855 vfs_writev fs/read_write.c:928 [inline] do_pwritev+0x1c8/0x2fc fs/read_write.c:1025 __do_sys_pwritev2 fs/read_write.c:1084 [inline] __se_sys_pwritev2 fs/read_write.c:1075 [inline] __arm64_sys_pwritev2+0xd4/0x108 fs/read_write.c:1075 __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