============================================ WARNING: possible recursive locking detected 6.12.0-syzkaller-09734-g445d9f05fa14 #0 Not tainted -------------------------------------------- syz-executor/5851 is trying to acquire lock: ffff88802f686648 ( &HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_get_block+0x277/0x9e0 fs/hfsplus/extents.c:260 but task is already holding lock: ffff88802f6822c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_truncate+0x204/0xb70 fs/hfsplus/extents.c:577 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-executor/5851: #0: ffff88805d904420 (sb_writers#13){.+.+}-{0:0}, at: do_unlinkat+0x1d3/0x760 fs/namei.c:4570 #1: ffff88802f686ef8 (&type->i_mutex_dir_key#8/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:853 [inline] #1: ffff88802f686ef8 (&type->i_mutex_dir_key#8/1){+.+.}-{4:4}, at: do_unlinkat+0x288/0x760 fs/namei.c:4574 #2: ffff88802f6824b8 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: inode_lock include/linux/fs.h:818 [inline] #2: ffff88802f6824b8 (&sb->s_type->i_mutex_key#21){++++}-{4:4}, at: vfs_unlink+0xd3/0x9b0 fs/namei.c:4512 #3: ffff888024ba1998 (&sbi->vh_mutex){+.+.}-{4:4}, at: hfsplus_unlink+0x184/0x7f0 fs/hfsplus/dir.c:370 #4: ffff88802f6822c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_truncate+0x204/0xb70 fs/hfsplus/extents.c:577 #5: ffff888024ba18f8 (&sbi->alloc_mutex){+.+.}-{4:4}, at: hfsplus_block_free+0xd2/0x530 fs/hfsplus/bitmap.c:182 stack backtrace: CPU: 1 UID: 0 PID: 5851 Comm: syz-executor Not tainted 6.12.0-syzkaller-09734-g445d9f05fa14 #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+0x116/0x1f0 lib/dump_stack.c:120 print_deadlock_bug+0x2e3/0x410 kernel/locking/lockdep.c:3037 check_deadlock kernel/locking/lockdep.c:3089 [inline] validate_chain kernel/locking/lockdep.c:3891 [inline] __lock_acquire+0x2117/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 hfsplus_get_block+0x277/0x9e0 fs/hfsplus/extents.c:260 block_read_full_folio+0x396/0xa50 fs/buffer.c:2396 filemap_read_folio+0xc9/0x2a0 mm/filemap.c:2366 do_read_cache_folio+0x263/0x5c0 mm/filemap.c:3826 do_read_cache_page mm/filemap.c:3892 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:3901 read_mapping_page include/linux/pagemap.h:1005 [inline] hfsplus_block_free+0x12f/0x530 fs/hfsplus/bitmap.c:185 hfsplus_free_extents+0x3a6/0x520 fs/hfsplus/extents.c:363 hfsplus_file_truncate+0x8dc/0xb70 fs/hfsplus/extents.c:592 hfsplus_delete_inode+0x18f/0x220 fs/hfsplus/inode.c:449 hfsplus_unlink+0x583/0x7f0 fs/hfsplus/dir.c:405 vfs_unlink+0x2fe/0x9b0 fs/namei.c:4523 do_unlinkat+0x570/0x760 fs/namei.c:4587 __do_sys_unlink fs/namei.c:4635 [inline] __se_sys_unlink fs/namei.c:4633 [inline] __x64_sys_unlink+0xc5/0x110 fs/namei.c:4633 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9e8737fdb7 Code: 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 57 00 00 00 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:00007ffe14f08278 EFLAGS: 00000206 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f9e8737fdb7 RDX: 00007ffe14f082a0 RSI: 00007ffe14f08330 RDI: 00007ffe14f08330 RBP: 00007ffe14f08330 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000206 R12: 00007ffe14f09420 R13: 00007f9e873f37dc R14: 000000000001c45a R15: 00007ffe14f0a4e0 hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent BTRFS info (device loop0): last unmount of filesystem 395ef67a-297e-477c-816d-cd80a5b93e5d