loop0: detected capacity change from 0 to 1024 ============================================ WARNING: possible recursive locking detected 6.12.0-rc7-syzkaller-00070-g0a9b9d17f3a7 #0 Not tainted -------------------------------------------- syz.0.0/5325 is trying to acquire lock: ffff88804fcf5548 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x383/0x14f0 fs/hfsplus/extents.c:260 but task is already holding lock: ffff88804fcf6988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x21b/0x1b70 fs/hfsplus/extents.c:458 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.0/5325: #0: ffff8880439d8420 (sb_writers#11){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2931 [inline] #0: ffff8880439d8420 (sb_writers#11){.+.+}-{0:0}, at: vfs_writev+0x2d1/0xba0 fs/read_write.c:1062 #1: ffff88804fcf6b78 (&sb->s_type->i_mutex_key#19){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:815 [inline] #1: ffff88804fcf6b78 (&sb->s_type->i_mutex_key#19){+.+.}-{3:3}, at: generic_file_write_iter+0x82/0x310 mm/filemap.c:4178 #2: ffff88804fcf6988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x21b/0x1b70 fs/hfsplus/extents.c:458 #3: ffff88804fcfa8f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_allocate+0x9e/0x8c0 fs/hfsplus/bitmap.c:35 stack backtrace: CPU: 0 UID: 0 PID: 5325 Comm: syz.0.0 Not tainted 6.12.0-rc7-syzkaller-00070-g0a9b9d17f3a7 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3037 check_deadlock kernel/locking/lockdep.c:3089 [inline] validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3891 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 hfsplus_get_block+0x383/0x14f0 fs/hfsplus/extents.c:260 block_read_full_folio+0x418/0xcd0 fs/buffer.c:2401 filemap_read_folio+0x14b/0x630 mm/filemap.c:2367 do_read_cache_folio+0x3f5/0x850 mm/filemap.c:3825 do_read_cache_page+0x30/0x200 mm/filemap.c:3891 read_mapping_page include/linux/pagemap.h:1005 [inline] hfsplus_block_allocate+0xee/0x8c0 fs/hfsplus/bitmap.c:37 hfsplus_file_extend+0xade/0x1b70 fs/hfsplus/extents.c:469 hfsplus_get_block+0x406/0x14f0 fs/hfsplus/extents.c:245 __block_write_begin_int+0x50c/0x1a70 fs/buffer.c:2121 block_write_begin fs/buffer.c:2231 [inline] cont_write_begin+0x6e2/0x9d0 fs/buffer.c:2582 hfsplus_write_begin+0x68/0xb0 fs/hfsplus/inode.c:46 cont_expand_zero fs/buffer.c:2509 [inline] cont_write_begin+0x338/0x9d0 fs/buffer.c:2572 hfsplus_write_begin+0x68/0xb0 fs/hfsplus/inode.c:46 generic_perform_write+0x344/0x6d0 mm/filemap.c:4054 generic_file_write_iter+0xae/0x310 mm/filemap.c:4181 do_iter_readv_writev+0x600/0x880 vfs_writev+0x376/0xba0 fs/read_write.c:1064 do_pwritev fs/read_write.c:1165 [inline] __do_sys_pwritev2 fs/read_write.c:1224 [inline] __se_sys_pwritev2+0x1ca/0x2d0 fs/read_write.c:1215 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe251f7e719 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:00007fe2519fe038 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007fe252135f80 RCX: 00007fe251f7e719 RDX: 0000000000000001 RSI: 00000000200001c0 RDI: 000000000000000a RBP: 00007fe251ff175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000005406 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fe252135f80 R15: 00007fff76880288