loop2: detected capacity change from 0 to 1024 ============================================ WARNING: possible recursive locking detected 5.15.185-syzkaller #0 Not tainted -------------------------------------------- syz.2.127/4743 is trying to acquire lock: ffff88807af5bdc8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x39b/0x1530 fs/hfsplus/extents.c:260 but task is already holding lock: ffff88807af5d208 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2a0/0xb40 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.2.127/4743: #0: ffff88801fadc460 (sb_writers#20){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:377 #1: ffff88807af5d400 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #1: ffff88807af5d400 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: do_truncate+0x183/0x220 fs/open.c:63 #2: ffff88807af5d208 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2a0/0xb40 fs/hfsplus/extents.c:577 #3: ffff88807e3888f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_free+0xc1/0x4d0 fs/hfsplus/bitmap.c:182 stack backtrace: CPU: 1 PID: 4743 Comm: syz.2.127 Not tainted 5.15.185-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 hfsplus_get_block+0x39b/0x1530 fs/hfsplus/extents.c:260 block_read_full_page+0x2e8/0xd10 fs/buffer.c:2290 do_read_cache_page+0x8a1/0x1030 mm/filemap.c:-1 read_mapping_page include/linux/pagemap.h:515 [inline] hfsplus_block_free+0x125/0x4d0 fs/hfsplus/bitmap.c:185 hfsplus_free_extents+0x176/0xac0 fs/hfsplus/extents.c:363 hfsplus_file_truncate+0x745/0xb40 fs/hfsplus/extents.c:592 hfsplus_setattr+0x1c0/0x280 fs/hfsplus/inode.c:267 notify_change+0xbcd/0xee0 fs/attr.c:505 do_truncate+0x197/0x220 fs/open.c:65 handle_truncate fs/namei.c:3265 [inline] do_open fs/namei.c:3612 [inline] path_openat+0x28af/0x2f30 fs/namei.c:3742 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769 do_sys_openat2+0x142/0x4a0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_open fs/open.c:1277 [inline] __se_sys_open fs/open.c:1273 [inline] __x64_sys_open+0x11b/0x140 fs/open.c:1273 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:0x7f91801c8929 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:00007f917e030038 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f91803effa0 RCX: 00007f91801c8929 RDX: 0000000000000006 RSI: 000000000014927e RDI: 00002000000000c0 RBP: 00007f918024ab39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f91803effa0 R15: 00007ffe98392898 hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent