loop0: detected capacity change from 0 to 1024 ============================================ WARNING: possible recursive locking detected 6.1.53-syzkaller #0 Not tainted -------------------------------------------- syz-executor130/3543 is trying to acquire lock: ffff88807d4a07c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x37f/0x14e0 fs/hfsplus/extents.c:260 but task is already holding lock: ffff88807c1187c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1d2/0x1b10 fs/hfsplus/extents.c:457 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 5 locks held by syz-executor130/3543: #0: ffff88807bd040e0 (&type->s_umount_key#41/1){+.+.}-{3:3}, at: alloc_super+0x217/0x930 fs/super.c:228 #1: ffff88807c3f1998 (&sbi->vh_mutex){+.+.}-{3:3}, at: hfsplus_fill_super+0x1378/0x1c90 fs/hfsplus/super.c:553 #2: ffff88807c1b40b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_find_init+0x146/0x1c0 #3: ffff88807c1187c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1d2/0x1b10 fs/hfsplus/extents.c:457 #4: ffff88807c3f18f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_allocate+0x9a/0x8b0 fs/hfsplus/bitmap.c:35 stack backtrace: CPU: 1 PID: 3543 Comm: syz-executor130 Not tainted 6.1.53-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2983 [inline] check_deadlock kernel/locking/lockdep.c:3026 [inline] validate_chain+0x4726/0x58e0 kernel/locking/lockdep.c:3811 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5048 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5661 __mutex_lock_common+0x1d4/0x2520 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799 hfsplus_get_block+0x37f/0x14e0 fs/hfsplus/extents.c:260 block_read_full_folio+0x403/0xf60 fs/buffer.c:2271 filemap_read_folio+0x199/0x780 mm/filemap.c:2407 do_read_cache_folio+0x2ee/0x810 mm/filemap.c:3535 do_read_cache_page+0x32/0x220 mm/filemap.c:3577 read_mapping_page include/linux/pagemap.h:756 [inline] hfsplus_block_allocate+0xea/0x8b0 fs/hfsplus/bitmap.c:37 hfsplus_file_extend+0xa4c/0x1b10 fs/hfsplus/extents.c:468 hfsplus_bmap_reserve+0x101/0x4e0 fs/hfsplus/btree.c:358 hfsplus_create_cat+0x1a9/0x1ba0 fs/hfsplus/catalog.c:272 hfsplus_fill_super+0x13e6/0x1c90 fs/hfsplus/super.c:560 mount_bdev+0x2c9/0x3f0 fs/super.c:1432 legacy_get_tree+0xeb/0x180 fs/fs_context.c:632 vfs_get_tree+0x88/0x270 fs/super.c:1562 do_new_mount+0x28b/0xae0 fs/namespace.c:3040 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f1a220e4c3a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffce08c3808 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007ffce08c3820 RCX: 00007f1a220e4c3a RDX: 0000000020000000 RSI: 0000000020000080 RDI: 00007ffce08c3820 RBP: 0000000000000004 R08: 00007ffce08c3860 R09: 000000000000064e R10: 0000000000208010 R11: 0000000000000286 R12: 0000000000208010 R13: 00007ffce08c3860 R14: 0000000000000003 R15: 0000000000080000