loop2: detected capacity change from 0 to 64 ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.2.215/7152 is trying to acquire lock: ffff888061efc0a0 (&tree->tree_lock#2/1){+.+.}-{4:4}, at: hfs_find_init+0x18e/0x2c0 fs/hfs/bfind.c:-1 but task is already holding lock: ffff888061d3e6a8 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_get_block+0x268/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){+.+.}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 __mutex_lock_common kernel/locking/rtmutex_api.c:535 [inline] mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:547 hfs_extend_file+0xda/0x14c0 fs/hfs/extent.c:397 hfs_bmap_reserve+0x107/0x430 fs/hfs/btree.c:269 __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+0x31e/0x14c0 fs/hfs/extent.c:401 hfs_get_block+0x3d7/0xbd0 fs/hfs/extent.c:353 __block_write_begin_int+0x6b5/0x1900 fs/buffer.c:2145 block_write_begin fs/buffer.c:2256 [inline] cont_write_begin+0x789/0xb50 fs/buffer.c:2594 hfs_write_begin+0x66/0xb0 fs/hfs/inode.c:52 cont_expand_zero fs/buffer.c:2522 [inline] cont_write_begin+0x2fd/0xb50 fs/buffer.c:2584 hfs_write_begin+0x66/0xb0 fs/hfs/inode.c:52 hfs_file_truncate+0x19d/0xad0 fs/hfs/extent.c:495 hfs_inode_setattr+0x4a9/0x670 fs/hfs/inode.c:665 notify_change+0xc18/0xf60 fs/attr.c:546 do_truncate+0x1a4/0x220 fs/open.c:68 do_ftruncate+0x495/0x550 fs/open.c:195 do_sys_ftruncate fs/open.c:210 [inline] __do_sys_ftruncate fs/open.c:215 [inline] __se_sys_ftruncate fs/open.c:213 [inline] __x64_sys_ftruncate+0x92/0xf0 fs/open.c:213 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&tree->tree_lock#2/1){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3908 __lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5237 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 __mutex_lock_common kernel/locking/rtmutex_api.c:535 [inline] mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:547 hfs_find_init+0x18e/0x2c0 fs/hfs/bfind.c:-1 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_get_block+0x51b/0xbd0 fs/hfs/extent.c:366 block_read_full_folio+0x29f/0x830 fs/buffer.c:2420 filemap_read_folio+0x117/0x380 mm/filemap.c:2444 do_read_cache_folio+0x2ba/0x560 mm/filemap.c:4036 do_read_cache_page mm/filemap.c:4102 [inline] read_cache_page+0x5d/0x170 mm/filemap.c:4111 read_mapping_page include/linux/pagemap.h:993 [inline] __hfs_bnode_create+0x521/0xb20 fs/hfs/bnode.c:388 hfs_bnode_find+0x24c/0xf50 fs/hfs/bnode.c:433 hfs_brec_find+0x172/0x510 fs/hfs/bfind.c:135 hfs_brec_read+0x24/0x110 fs/hfs/bfind.c:174 hfs_cat_find_brec+0x15c/0x3f0 fs/hfs/catalog.c:194 hfs_fill_super+0x4be/0x6b0 fs/hfs/super.c:354 get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1691 vfs_get_tree+0x92/0x2b0 fs/super.c:1751 fc_mount fs/namespace.c:1208 [inline] do_new_mount_fc fs/namespace.c:3651 [inline] do_new_mount+0x302/0xa10 fs/namespace.c:3727 do_mount fs/namespace.c:4050 [inline] __do_sys_mount fs/namespace.c:4238 [inline] __se_sys_mount+0x313/0x410 fs/namespace.c:4215 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f 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#2/1); lock(&HFS_I(tree->inode)->extents_lock); lock(&tree->tree_lock#2/1); *** DEADLOCK *** 3 locks held by syz.2.215/7152: #0: ffff8880632dc0d0 (&type->s_umount_key#104/1){+.+.}-{4:4}, at: alloc_super+0x1ba/0x9a0 fs/super.c:344 #1: ffff888061efe0a0 (&tree->tree_lock#2){+.+.}-{4:4}, at: hfs_find_init+0x18e/0x2c0 fs/hfs/bfind.c:-1 #2: ffff888061d3e6a8 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_get_block+0x268/0xbd0 fs/hfs/extent.c:365 stack backtrace: CPU: 1 UID: 0 PID: 7152 Comm: syz.2.215 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_circular_bug+0x2ee/0x310 kernel/locking/lockdep.c:2043 check_noncircular+0x134/0x160 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3908 __lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5237 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 __mutex_lock_common kernel/locking/rtmutex_api.c:535 [inline] mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:547 hfs_find_init+0x18e/0x2c0 fs/hfs/bfind.c:-1 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_get_block+0x51b/0xbd0 fs/hfs/extent.c:366 block_read_full_folio+0x29f/0x830 fs/buffer.c:2420 filemap_read_folio+0x117/0x380 mm/filemap.c:2444 do_read_cache_folio+0x2ba/0x560 mm/filemap.c:4036 do_read_cache_page mm/filemap.c:4102 [inline] read_cache_page+0x5d/0x170 mm/filemap.c:4111 read_mapping_page include/linux/pagemap.h:993 [inline] __hfs_bnode_create+0x521/0xb20 fs/hfs/bnode.c:388 hfs_bnode_find+0x24c/0xf50 fs/hfs/bnode.c:433 hfs_brec_find+0x172/0x510 fs/hfs/bfind.c:135 hfs_brec_read+0x24/0x110 fs/hfs/bfind.c:174 hfs_cat_find_brec+0x15c/0x3f0 fs/hfs/catalog.c:194 hfs_fill_super+0x4be/0x6b0 fs/hfs/super.c:354 get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1691 vfs_get_tree+0x92/0x2b0 fs/super.c:1751 fc_mount fs/namespace.c:1208 [inline] do_new_mount_fc fs/namespace.c:3651 [inline] do_new_mount+0x302/0xa10 fs/namespace.c:3727 do_mount fs/namespace.c:4050 [inline] __do_sys_mount fs/namespace.c:4238 [inline] __se_sys_mount+0x313/0x410 fs/namespace.c:4215 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fd2407b0e6a 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:00007fd23ea0de68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fd23ea0def0 RCX: 00007fd2407b0e6a RDX: 0000200000000180 RSI: 0000200000000000 RDI: 00007fd23ea0deb0 RBP: 0000200000000180 R08: 00007fd23ea0def0 R09: 0000000001004002 R10: 0000000001004002 R11: 0000000000000246 R12: 0000200000000000 R13: 00007fd23ea0deb0 R14: 0000000000000319 R15: 0000200000000040 hfs: get root inode failed loop2: detected capacity change from 0 to 32768 XFS (loop2): Mounting V5 Filesystem bfdc47fc-10d8-4eed-a562-11a831b3f791 XFS (loop2): Ending clean mount XFS (loop2): Quotacheck needed: Please wait. XFS (loop2): Quotacheck: Done.