============================================ WARNING: possible recursive locking detected 5.15.189-syzkaller #0 Not tainted -------------------------------------------- syz.0.101/4759 is trying to acquire lock: ffff888023ab80b0 (&tree->tree_lock#2/1){+.+.}-{3:3}, at: hfs_find_init+0x15b/0x1d0 fs/hfs/bfind.c:-1 but task is already holding lock: ffff888023ab80b0 (&tree->tree_lock#2/1){+.+.}-{3:3}, at: hfs_find_init+0x15b/0x1d0 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.0.101/4759: #0: ffff888023aba460 (sb_writers#24){.+.+}-{0:0}, at: vfs_write+0x28a/0xd00 fs/read_write.c:590 #1: ffff8880593ca9a8 (&sb->s_type->i_mutex_key#31){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #1: ffff8880593ca9a8 (&sb->s_type->i_mutex_key#31){+.+.}-{3:3}, at: generic_file_write_iter+0x7e/0x1b0 mm/filemap.c:3941 #2: ffff8880593ca7f8 (&HFS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xd7/0x1280 fs/hfs/extent.c:397 #3: ffff888023ab80b0 (&tree->tree_lock#2/1){+.+.}-{3:3}, at: hfs_find_init+0x15b/0x1d0 fs/hfs/bfind.c:-1 #4: ffff8880593c9478 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xd7/0x1280 fs/hfs/extent.c:397 stack backtrace: CPU: 1 PID: 4759 Comm: syz.0.101 Not tainted 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 __lock_acquire+0x1227/0x7c60 kernel/locking/lockdep.c:-1 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1eb/0x2390 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 hfs_find_init+0x15b/0x1d0 fs/hfs/bfind.c:-1 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_extend_file+0x2eb/0x1280 fs/hfs/extent.c:401 hfs_bmap_reserve+0x103/0x420 fs/hfs/btree.c:231 __hfs_ext_write_extent+0x1fa/0x470 fs/hfs/extent.c:121 __hfs_ext_cache_extent+0x6b/0x9b0 fs/hfs/extent.c:174 hfs_ext_read_extent fs/hfs/extent.c:202 [inline] hfs_extend_file+0x313/0x1280 fs/hfs/extent.c:401 hfs_get_block+0x3d4/0xbd0 fs/hfs/extent.c:353 __block_write_begin_int+0x54e/0x15a0 fs/buffer.c:2012 __block_write_begin fs/buffer.c:2062 [inline] block_write_begin fs/buffer.c:2122 [inline] cont_write_begin+0x58a/0x7b0 fs/buffer.c:2471 hfs_write_begin+0x92/0xe0 fs/hfs/inode.c:59 cont_expand_zero fs/buffer.c:2398 [inline] cont_write_begin+0x26c/0x7b0 fs/buffer.c:2461 hfs_write_begin+0x92/0xe0 fs/hfs/inode.c:59 generic_perform_write+0x2aa/0x530 mm/filemap.c:3785 __generic_file_write_iter+0x25f/0x4e0 mm/filemap.c:3912 generic_file_write_iter+0xa6/0x1b0 mm/filemap.c:3944 call_write_iter include/linux/fs.h:2172 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x712/0xd00 fs/read_write.c:594 ksys_pwrite64 fs/read_write.c:701 [inline] __do_sys_pwrite64 fs/read_write.c:711 [inline] __se_sys_pwrite64 fs/read_write.c:708 [inline] __x64_sys_pwrite64+0x194/0x220 fs/read_write.c:708 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7efc1656ebe9 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:00007efc147d6038 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007efc16795fa0 RCX: 00007efc1656ebe9 RDX: 000000000000ff10 RSI: 0000200000000140 RDI: 0000000000000005 RBP: 00007efc165f1e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000008000c61 R11: 0000000000000246 R12: 0000000000000000 R13: 00007efc16796038 R14: 00007efc16795fa0 R15: 00007ffc113bc758