loop0: detected capacity change from 0 to 1024 ============================================ WARNING: possible recursive locking detected 6.1.141-syzkaller #0 Not tainted -------------------------------------------- syz.0.21/4409 is trying to acquire lock: ffff8880729a1548 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x39b/0x1530 fs/hfsplus/extents.c:260 but task is already holding lock: ffff888029000108 (&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.0.21/4409: #0: ffff88807798a460 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:393 #1: ffff888029000300 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff888029000300 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: do_truncate+0x183/0x220 fs/open.c:63 #2: ffff888029000108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x28f/0xb30 fs/hfsplus/extents.c:577 #3: ffff888055c080f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_free+0xbf/0x4b0 fs/hfsplus/bitmap.c:182 stack backtrace: CPU: 0 PID: 4409 Comm: syz.0.21 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_open fs/open.c:1342 [inline] __se_sys_open fs/open.c:1338 [inline] __x64_sys_open+0x11b/0x140 fs/open.c:1338 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:0x7f808378e929 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:00007f8084573038 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f80839b5fa0 RCX: 00007f808378e929 RDX: 0000000000000006 RSI: 000000000014927e RDI: 00002000000000c0 RBP: 00007f8083810b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f80839b5fa0 R15: 00007ffe3d10ee38 hfsplus: unable to mark blocks free: error -4 hfsplus: can't free extent