loop0: detected capacity change from 0 to 1024 ============================================ WARNING: possible recursive locking detected 6.12.0-rc3-syzkaller-g9ec59cb3edc7 #0 Tainted: G W -------------------------------------------- syz-executor159/6421 is trying to acquire lock: ffff0000d8eb87c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x2c4/0x1168 fs/hfsplus/extents.c:260 but task is already holding lock: ffff0000d8eb9c08 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x24c/0xa18 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-executor159/6421: #0: ffff0000c2c98420 (sb_writers#8){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:515 #1: ffff0000d8eb9df8 (&sb->s_type->i_mutex_key#16){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:815 [inline] #1: ffff0000d8eb9df8 (&sb->s_type->i_mutex_key#16){+.+.}-{3:3}, at: do_truncate+0x1ac/0x28c fs/open.c:63 #2: ffff0000d8eb9c08 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x24c/0xa18 fs/hfsplus/extents.c:577 #3: ffff0000dc1fd8f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_free+0xcc/0x4b8 fs/hfsplus/bitmap.c:182 stack backtrace: CPU: 0 UID: 0 PID: 6421 Comm: syz-executor159 Tainted: G W 6.12.0-rc3-syzkaller-g9ec59cb3edc7 #0 Tainted: [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:484 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_deadlock_bug+0x4e8/0x668 kernel/locking/lockdep.c:3037 check_deadlock kernel/locking/lockdep.c:3089 [inline] validate_chain kernel/locking/lockdep.c:3891 [inline] __lock_acquire+0x6180/0x77c8 kernel/locking/lockdep.c:5202 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5825 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 hfsplus_get_block+0x2c4/0x1168 fs/hfsplus/extents.c:260 block_read_full_folio+0x3c4/0xbe0 fs/buffer.c:2401 hfsplus_read_folio+0x28/0x38 fs/hfsplus/inode.c:28 filemap_read_folio+0x108/0x318 mm/filemap.c:2367 do_read_cache_folio+0x368/0x5c0 mm/filemap.c:3825 do_read_cache_page mm/filemap.c:3891 [inline] read_cache_page+0x6c/0x15c mm/filemap.c:3900 read_mapping_page include/linux/pagemap.h:1005 [inline] hfsplus_block_free+0x11c/0x4b8 fs/hfsplus/bitmap.c:185 hfsplus_free_extents+0x148/0x8d4 fs/hfsplus/extents.c:363 hfsplus_file_truncate+0x674/0xa18 fs/hfsplus/extents.c:592 hfsplus_setattr+0x184/0x24c fs/hfsplus/inode.c:264 notify_change+0x9f0/0xca0 fs/attr.c:503 do_truncate+0x1c0/0x28c fs/open.c:65 handle_truncate fs/namei.c:3395 [inline] do_open fs/namei.c:3778 [inline] path_openat+0x2494/0x2b14 fs/namei.c:3933 do_filp_open+0x1bc/0x3cc fs/namei.c:3960 do_sys_openat2+0x124/0x1b8 fs/open.c:1415 do_sys_open fs/open.c:1430 [inline] __do_sys_openat fs/open.c:1446 [inline] __se_sys_openat fs/open.c:1441 [inline] __arm64_sys_openat+0x1f0/0x240 fs/open.c:1441 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent