hfsplus: request for non-existent node 33423360 in B*Tree hfsplus: request for non-existent node 33423360 in B*Tree ============================================ WARNING: possible recursive locking detected 6.13.0-rc7-syzkaller #0 Not tainted -------------------------------------------- syz-executor551/5826 is trying to acquire lock: ffff88807f6f1548 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_get_block+0x383/0x14f0 fs/hfsplus/extents.c:260 but task is already holding lock: ffff88807f6f07c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21b/0x1b70 fs/hfsplus/extents.c:458 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&HFSPLUS_I(inode)->extents_lock); lock(&HFSPLUS_I(inode)->extents_lock); *** DEADLOCK *** May be due to missing lock nesting notation 6 locks held by syz-executor551/5826: #0: ffff88807a74c420 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:516 #1: ffff88807f6f1df8 (&type->i_mutex_dir_key#6){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:818 [inline] #1: ffff88807f6f1df8 (&type->i_mutex_dir_key#6){+.+.}-{4:4}, at: open_last_lookups fs/namei.c:3745 [inline] #1: ffff88807f6f1df8 (&type->i_mutex_dir_key#6){+.+.}-{4:4}, at: path_openat+0x89a/0x3590 fs/namei.c:3984 #2: ffff888143bef198 (&sbi->vh_mutex){+.+.}-{4:4}, at: hfsplus_mknod+0x7e/0x2a0 fs/hfsplus/dir.c:486 #3: ffff88807fc320b0 (&tree->tree_lock){+.+.}-{4:4}, at: hfsplus_find_init+0x14a/0x1c0 fs/hfsplus/bfind.c:28 #4: ffff88807f6f07c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21b/0x1b70 fs/hfsplus/extents.c:458 #5: ffff888143bef0f8 (&sbi->alloc_mutex){+.+.}-{4:4}, at: hfsplus_block_allocate+0x9e/0x8c0 fs/hfsplus/bitmap.c:35 stack backtrace: CPU: 0 UID: 0 PID: 5826 Comm: syz-executor551 Not tainted 6.13.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3037 check_deadlock kernel/locking/lockdep.c:3089 [inline] validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3891 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5226 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x1ac/0xee0 kernel/locking/mutex.c:735 hfsplus_get_block+0x383/0x14f0 fs/hfsplus/extents.c:260 block_read_full_folio+0x3ee/0xae0 fs/buffer.c:2396 filemap_read_folio+0x148/0x3b0 mm/filemap.c:2357 do_read_cache_folio+0x373/0x5b0 mm/filemap.c:3817 do_read_cache_page mm/filemap.c:3883 [inline] read_cache_page+0x5b/0x170 mm/filemap.c:3892 read_mapping_page include/linux/pagemap.h:1005 [inline] hfsplus_block_allocate+0xee/0x8c0 fs/hfsplus/bitmap.c:37 hfsplus_file_extend+0xade/0x1b70 fs/hfsplus/extents.c:469 hfsplus_bmap_reserve+0x105/0x4e0 fs/hfsplus/btree.c:358 hfsplus_create_cat+0x1b0/0x1b70 fs/hfsplus/catalog.c:272 hfsplus_mknod+0x16a/0x2a0 fs/hfsplus/dir.c:494 lookup_open fs/namei.c:3649 [inline] open_last_lookups fs/namei.c:3748 [inline] path_openat+0x1c03/0x3590 fs/namei.c:3984 do_filp_open+0x27f/0x4e0 fs/namei.c:4014 do_sys_openat2+0x13e/0x1d0 fs/open.c:1402 do_sys_open fs/open.c:1417 [inline] __do_sys_openat fs/open.c:1433 [inline] __se_sys_openat fs/open.c:1428 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1428 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f30381df009 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 18 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3038195168 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f30382666c8 RCX: 00007f30381df009 RDX: 000000000000275a RSI: 0000000020000080 RDI: 0000000000000005 RBP: 00007f30382666c0 R08: 00007f30381956c0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f30382666cc R13: 0000000000000006 R14: 00007ffe7c2e3e90 R15: 00007ffe7c2e3f78