loop2: detected capacity change from 0 to 64 ====================================================== WARNING: possible circular locking dependency detected 5.15.182-syzkaller #0 Not tainted ------------------------------------------------------ syz.2.304/5990 is trying to acquire lock: ffff8880643640b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x15b/0x1d0 fs/hfs/bfind.c:-1 but task is already holding lock: ffff888053880778 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_get_block+0x265/0xbd0 fs/hfs/extent.c:365 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}: __mutex_lock_common+0x1eb/0x2390 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 hfs_extend_file+0xd7/0x1280 fs/hfs/extent.c:397 hfs_bmap_reserve+0x103/0x420 fs/hfs/btree.c:231 __hfs_ext_write_extent+0x1fa/0x470 fs/hfs/extent.c:121 __hfs_ext_cache_extent+0x6b/0x9b0 fs/hfs/extent.c:174 hfs_ext_read_extent fs/hfs/extent.c:202 [inline] hfs_extend_file+0x313/0x1280 fs/hfs/extent.c:401 hfs_get_block+0x3d4/0xbd0 fs/hfs/extent.c:353 __block_write_begin_int+0x54e/0x15a0 fs/buffer.c:2012 __block_write_begin fs/buffer.c:2062 [inline] block_write_begin fs/buffer.c:2122 [inline] cont_write_begin+0x58a/0x7b0 fs/buffer.c:2471 hfs_write_begin+0x92/0xe0 fs/hfs/inode.c:59 generic_perform_write+0x2aa/0x530 mm/filemap.c:3785 __generic_file_write_iter+0x25f/0x4e0 mm/filemap.c:3912 generic_file_write_iter+0xa6/0x1b0 mm/filemap.c:3944 call_write_iter include/linux/fs.h:2172 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x712/0xd00 fs/read_write.c:594 ksys_write+0x14d/0x250 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (&tree->tree_lock/1){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1eb/0x2390 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 hfs_find_init+0x15b/0x1d0 fs/hfs/bfind.c:-1 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_get_block+0x518/0xbd0 fs/hfs/extent.c:366 block_read_full_page+0x2e8/0xd10 fs/buffer.c:2290 do_read_cache_page+0x8a1/0x1030 mm/filemap.c:-1 read_mapping_page include/linux/pagemap.h:515 [inline] __hfs_bnode_create+0x4f0/0xba0 fs/hfs/bnode.c:303 hfs_bnode_find+0x220/0xce0 fs/hfs/bnode.c:352 hfs_brec_find+0x156/0x500 fs/hfs/bfind.c:126 hfs_brec_read+0x20/0x100 fs/hfs/bfind.c:165 hfs_cat_find_brec+0x159/0x3f0 fs/hfs/catalog.c:194 hfs_fill_super+0xeb4/0x13f0 fs/hfs/super.c:419 mount_bdev+0x287/0x3c0 fs/super.c:1400 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x24a/0xa40 fs/namespace.c:3013 do_mount fs/namespace.c:3356 [inline] __do_sys_mount fs/namespace.c:3564 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3541 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&HFS_I(tree->inode)->extents_lock); lock(&tree->tree_lock/1); lock(&HFS_I(tree->inode)->extents_lock); lock(&tree->tree_lock/1); *** DEADLOCK *** 3 locks held by syz.2.304/5990: #0: ffff8880298c80e0 (&type->s_umount_key#88/1){+.+.}-{3:3}, at: alloc_super+0x201/0x950 fs/super.c:229 #1: ffff8880643620b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfs_find_init+0x15b/0x1d0 fs/hfs/bfind.c:-1 #2: ffff888053880778 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_get_block+0x265/0xbd0 fs/hfs/extent.c:365 stack backtrace: CPU: 0 PID: 5990 Comm: syz.2.304 Not tainted 5.15.182-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1eb/0x2390 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 hfs_find_init+0x15b/0x1d0 fs/hfs/bfind.c:-1 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_get_block+0x518/0xbd0 fs/hfs/extent.c:366 block_read_full_page+0x2e8/0xd10 fs/buffer.c:2290 do_read_cache_page+0x8a1/0x1030 mm/filemap.c:-1 read_mapping_page include/linux/pagemap.h:515 [inline] __hfs_bnode_create+0x4f0/0xba0 fs/hfs/bnode.c:303 hfs_bnode_find+0x220/0xce0 fs/hfs/bnode.c:352 hfs_brec_find+0x156/0x500 fs/hfs/bfind.c:126 hfs_brec_read+0x20/0x100 fs/hfs/bfind.c:165 hfs_cat_find_brec+0x159/0x3f0 fs/hfs/catalog.c:194 hfs_fill_super+0xeb4/0x13f0 fs/hfs/super.c:419 mount_bdev+0x287/0x3c0 fs/super.c:1400 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x24a/0xa40 fs/namespace.c:3013 do_mount fs/namespace.c:3356 [inline] __do_sys_mount fs/namespace.c:3564 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3541 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f484131410a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f483f179e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f483f179ef0 RCX: 00007f484131410a RDX: 0000200000000080 RSI: 0000200000000040 RDI: 00007f483f179eb0 RBP: 0000200000000080 R08: 00007f483f179ef0 R09: 0000000000200040 R10: 0000000000200040 R11: 0000000000000246 R12: 0000200000000040 R13: 00007f483f179eb0 R14: 0000000000000346 R15: 0000200000000300 hfs: get root inode failed