loop2: detected capacity change from 0 to 64 ====================================================== WARNING: possible circular locking dependency detected 5.15.189-syzkaller #0 Not tainted ------------------------------------------------------ syz.2.85/4742 is trying to acquire lock: ffff88807a16e0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x15b/0x1d0 fs/hfs/bfind.c:-1 but task is already holding lock: ffff888079338df8 (&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 cont_expand_zero fs/buffer.c:2398 [inline] cont_write_begin+0x26c/0x7b0 fs/buffer.c:2461 hfs_write_begin+0x92/0xe0 fs/hfs/inode.c:59 hfs_file_truncate+0x18f/0x9c0 fs/hfs/extent.c:494 hfs_inode_setattr+0x4ab/0x6f0 fs/hfs/inode.c:657 notify_change+0xbcd/0xee0 fs/attr.c:505 do_truncate+0x197/0x220 fs/open.c:65 do_sys_ftruncate+0x31b/0x3d0 fs/open.c:193 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:3014 do_mount fs/namespace.c:3357 [inline] __do_sys_mount fs/namespace.c:3565 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3542 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.85/4742: #0: ffff88801b9280e0 (&type->s_umount_key#54/1){+.+.}-{3:3}, at: alloc_super+0x201/0x950 fs/super.c:229 #1: ffff88807a16c0b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfs_find_init+0x15b/0x1d0 fs/hfs/bfind.c:-1 #2: ffff888079338df8 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_get_block+0x265/0xbd0 fs/hfs/extent.c:365 stack backtrace: CPU: 0 PID: 4742 Comm: syz.2.85 Not tainted 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/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:3014 do_mount fs/namespace.c:3357 [inline] __do_sys_mount fs/namespace.c:3565 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3542 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:0x7f607844838a 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:00007f60766ade68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f60766adef0 RCX: 00007f607844838a RDX: 0000200000000180 RSI: 0000200000000080 RDI: 00007f60766adeb0 RBP: 0000200000000180 R08: 00007f60766adef0 R09: 0000000003000002 R10: 0000000003000002 R11: 0000000000000246 R12: 0000200000000080 R13: 00007f60766adeb0 R14: 00000000000002fe R15: 0000200000000300 hfs: get root inode failed