============================================ WARNING: possible recursive locking detected 5.15.189-syzkaller #0 Not tainted -------------------------------------------- syz.0.324/5359 is trying to acquire lock: ffff8880593220b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x15b/0x1d0 fs/hfs/bfind.c:-1 but task is already holding lock: ffff8880593220b0 (&tree->tree_lock/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/1); lock(&tree->tree_lock/1); *** DEADLOCK *** May be due to missing lock nesting notation 6 locks held by syz.0.324/5359: #0: ffff88802adc2870 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x2bf/0x370 fs/file.c:1058 #1: ffff888078988460 (sb_writers#22){.+.+}-{0:0}, at: vfs_write+0x28a/0xd00 fs/read_write.c:590 #2: ffff888058b62328 (&sb->s_type->i_mutex_key#30){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #2: ffff888058b62328 (&sb->s_type->i_mutex_key#30){+.+.}-{3:3}, at: generic_file_write_iter+0x7e/0x1b0 mm/filemap.c:3941 #3: ffff888058b62178 (&HFS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xd7/0x1280 fs/hfs/extent.c:397 #4: ffff8880593220b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x15b/0x1d0 fs/hfs/bfind.c:-1 #5: ffff888058b60778 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xd7/0x1280 fs/hfs/extent.c:397 stack backtrace: CPU: 1 PID: 5359 Comm: syz.0.324 Not tainted 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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 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_write+0x14d/0x250 fs/read_write.c:647 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:0x7f168b43c9a9 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:00007f16892a4038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f168b663fa0 RCX: 00007f168b43c9a9 RDX: 000000000208e24b RSI: 0000200000000240 RDI: 0000000000000005 RBP: 00007f168b4bed69 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f168b663fa0 R15: 00007fff2d536c28