============================================ WARNING: possible recursive locking detected 6.1.141-syzkaller #0 Not tainted -------------------------------------------- syz.5.1105/8688 is trying to acquire lock: ffff888027eb5f88 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x39b/0x1530 fs/hfsplus/extents.c:260 but task is already holding lock: ffff888027eb73c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x28f/0xb30 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 4 locks held by syz.5.1105/8688: #0: ffff88801e244460 (sb_writers#25){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:393 #1: ffff888027eb75c0 (&sb->s_type->i_mutex_key#29){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff888027eb75c0 (&sb->s_type->i_mutex_key#29){+.+.}-{3:3}, at: do_truncate+0x183/0x220 fs/open.c:63 #2: ffff888027eb73c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x28f/0xb30 fs/hfsplus/extents.c:577 #3: ffff8880567390f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_free+0xbf/0x4b0 fs/hfsplus/bitmap.c:182 stack backtrace: CPU: 0 PID: 8688 Comm: syz.5.1105 Not tainted 6.1.141-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 __lock_acquire+0x122f/0x7c50 kernel/locking/lockdep.c:-1 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x120/0xaf0 kernel/locking/mutex.c:747 hfsplus_get_block+0x39b/0x1530 fs/hfsplus/extents.c:260 block_read_full_folio+0x3c9/0xed0 fs/buffer.c:2271 filemap_read_folio+0x160/0x760 mm/filemap.c:2490 do_read_cache_folio+0x2a0/0x760 mm/filemap.c:3627 do_read_cache_page+0x32/0x220 mm/filemap.c:3669 read_mapping_page include/linux/pagemap.h:791 [inline] hfsplus_block_free+0x128/0x4b0 fs/hfsplus/bitmap.c:185 hfsplus_free_extents+0x176/0xac0 fs/hfsplus/extents.c:363 hfsplus_file_truncate+0x731/0xb30 fs/hfsplus/extents.c:592 hfsplus_setattr+0x1c0/0x280 fs/hfsplus/inode.c:269 notify_change+0xc74/0xf40 fs/attr.c:499 do_truncate+0x197/0x220 fs/open.c:65 handle_truncate fs/namei.c:3285 [inline] do_open fs/namei.c:3630 [inline] path_openat+0x27f2/0x2e70 fs/namei.c:3783 do_filp_open+0x1c1/0x3c0 fs/namei.c:3810 do_sys_openat2+0x142/0x490 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_creat fs/open.c:1412 [inline] __se_sys_creat fs/open.c:1406 [inline] __x64_sys_creat+0x8c/0xb0 fs/open.c:1406 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f90cff8e929 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:00007f90d0ec8038 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f90d01b5fa0 RCX: 00007f90cff8e929 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000200000000200 RBP: 00007f90d0010b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f90d01b5fa0 R15: 00007ffd48a60728 hfsplus: unable to mark blocks free: error -4 hfsplus: can't free extent