loop2: detected capacity change from 0 to 1024 ====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0 Not tainted ------------------------------------------------------ syz-executor.2/6872 is trying to acquire lock: ffff88802fa340b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfsplus_find_init+0x16e/0x200 fs/hfsplus/bfind.c:33 but task is already holding lock: ffff88802abf9c08 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x277/0x9e0 fs/hfsplus/extents.c:260 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 hfsplus_file_extend+0x1c1/0x1090 fs/hfsplus/extents.c:457 hfsplus_bmap_reserve+0x31c/0x410 fs/hfsplus/btree.c:358 __hfsplus_ext_write_extent+0x474/0x5e0 fs/hfsplus/extents.c:104 hfsplus_ext_write_extent_locked fs/hfsplus/extents.c:139 [inline] hfsplus_ext_write_extent_locked fs/hfsplus/extents.c:129 [inline] hfsplus_ext_write_extent+0x1c9/0x210 fs/hfsplus/extents.c:150 hfsplus_write_inode+0x22/0x4f0 fs/hfsplus/super.c:154 write_inode fs/fs-writeback.c:1497 [inline] __writeback_single_inode+0xb36/0xf90 fs/fs-writeback.c:1716 writeback_single_inode+0x2b5/0x5a0 fs/fs-writeback.c:1772 sync_inode_metadata+0xa5/0xf0 fs/fs-writeback.c:2842 hfsplus_file_fsync+0x115/0x5d0 fs/hfsplus/inode.c:317 vfs_fsync_range+0x141/0x230 fs/sync.c:188 generic_write_sync include/linux/fs.h:2794 [inline] generic_file_write_iter+0x2ac/0x350 mm/filemap.c:4140 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6b6/0x1140 fs/read_write.c:590 ksys_write+0x12f/0x260 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&tree->tree_lock/1){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 hfsplus_find_init+0x16e/0x200 fs/hfsplus/bfind.c:33 hfsplus_ext_read_extent+0x18f/0x250 fs/hfsplus/extents.c:216 hfsplus_get_block+0x2b7/0x9e0 fs/hfsplus/extents.c:268 block_read_full_folio+0x38f/0xa70 fs/buffer.c:2407 filemap_read_folio+0xe5/0x2c0 mm/filemap.c:2355 do_read_cache_folio+0x203/0x540 mm/filemap.c:3788 do_read_cache_page mm/filemap.c:3854 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:3863 read_mapping_page include/linux/pagemap.h:896 [inline] __hfs_bnode_create+0x63e/0x870 fs/hfsplus/bnode.c:440 hfsplus_bnode_find+0x2c8/0xcb0 fs/hfsplus/bnode.c:486 hfsplus_brec_find+0x2b9/0x520 fs/hfsplus/bfind.c:183 hfsplus_brec_read+0x2d/0x120 fs/hfsplus/bfind.c:222 hfsplus_find_cat+0x1e3/0x4d0 fs/hfsplus/catalog.c:202 hfsplus_iget+0x3bd/0x7a0 fs/hfsplus/super.c:82 hfsplus_fill_super+0xca8/0x1bc0 fs/hfsplus/super.c:509 mount_bdev+0x1e3/0x2d0 fs/super.c:1659 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1780 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __x64_sys_mount+0x297/0x320 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&HFSPLUS_I(inode)->extents_lock); lock(&tree->tree_lock/1); lock(&HFSPLUS_I(inode)->extents_lock); lock(&tree->tree_lock/1); *** DEADLOCK *** 3 locks held by syz-executor.2/6872: #0: ffff888023d3a0e0 (&type->s_umount_key#101/1){+.+.}-{3:3}, at: alloc_super+0x23d/0xbd0 fs/super.c:344 #1: ffff88802fa360b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_find_init+0x1a7/0x200 fs/hfsplus/bfind.c:30 #2: ffff88802abf9c08 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x277/0x9e0 fs/hfsplus/extents.c:260 stack backtrace: CPU: 2 PID: 6872 Comm: syz-executor.2 Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 hfsplus_find_init+0x16e/0x200 fs/hfsplus/bfind.c:33 hfsplus_ext_read_extent+0x18f/0x250 fs/hfsplus/extents.c:216 hfsplus_get_block+0x2b7/0x9e0 fs/hfsplus/extents.c:268 block_read_full_folio+0x38f/0xa70 fs/buffer.c:2407 filemap_read_folio+0xe5/0x2c0 mm/filemap.c:2355 do_read_cache_folio+0x203/0x540 mm/filemap.c:3788 do_read_cache_page mm/filemap.c:3854 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:3863 read_mapping_page include/linux/pagemap.h:896 [inline] __hfs_bnode_create+0x63e/0x870 fs/hfsplus/bnode.c:440 hfsplus_bnode_find+0x2c8/0xcb0 fs/hfsplus/bnode.c:486 hfsplus_brec_find+0x2b9/0x520 fs/hfsplus/bfind.c:183 hfsplus_brec_read+0x2d/0x120 fs/hfsplus/bfind.c:222 hfsplus_find_cat+0x1e3/0x4d0 fs/hfsplus/catalog.c:202 hfsplus_iget+0x3bd/0x7a0 fs/hfsplus/super.c:82 hfsplus_fill_super+0xca8/0x1bc0 fs/hfsplus/super.c:509 mount_bdev+0x1e3/0x2d0 fs/super.c:1659 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1780 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __x64_sys_mount+0x297/0x320 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f969467e5ea Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f96941feef8 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f96941fef80 RCX: 00007f969467e5ea RDX: 0000000020000040 RSI: 0000000020000080 RDI: 00007f96941fef40 RBP: 0000000020000040 R08: 00007f96941fef80 R09: 0000000002000010 R10: 0000000002000010 R11: 0000000000000206 R12: 0000000020000080 R13: 00007f96941fef40 R14: 00000000000006b3 R15: 00000000200013c0 hfsplus: failed to load root directory