loop7: detected capacity change from 0 to 64 ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.7.3311/19707 is trying to acquire lock: ffff88806020a0b0 (&tree->tree_lock#2/1){+.+.}-{4:4}, at: hfs_find_init+0x1c3/0x240 fs/hfs/bfind.c:36 but task is already holding lock: ffff888031a3e278 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_get_block+0x553/0x830 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}: __mutex_lock_common kernel/locking/mutex.c:598 [inline] __mutex_lock+0x193/0x1060 kernel/locking/mutex.c:760 hfs_extend_file+0xa1/0xb10 fs/hfs/extent.c:397 hfs_bmap_reserve+0x2a2/0x390 fs/hfs/btree.c:269 __hfs_ext_write_extent+0x3cf/0x520 fs/hfs/extent.c:121 __hfs_ext_cache_extent fs/hfs/extent.c:174 [inline] hfs_ext_read_extent+0x807/0x9e0 fs/hfs/extent.c:202 hfs_extend_file+0x4e2/0xb10 fs/hfs/extent.c:401 hfs_get_block+0x17f/0x830 fs/hfs/extent.c:353 __block_write_begin_int+0x4f4/0x16d0 fs/buffer.c:2145 block_write_begin+0x9a/0x1d0 fs/buffer.c:2256 cont_write_begin+0x61b/0x950 fs/buffer.c:2594 hfs_write_begin+0x64/0x120 fs/hfs/inode.c:52 cont_expand_zero fs/buffer.c:2522 [inline] cont_write_begin+0x350/0x950 fs/buffer.c:2584 hfs_write_begin+0x64/0x120 fs/hfs/inode.c:52 generic_perform_write+0x3c5/0x900 mm/filemap.c:4175 __generic_file_write_iter+0x1f7/0x240 mm/filemap.c:4292 generic_file_write_iter+0xe1/0x3c0 mm/filemap.c:4318 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x7d3/0x11d0 fs/read_write.c:686 ksys_pwrite64 fs/read_write.c:793 [inline] __do_sys_pwrite64 fs/read_write.c:801 [inline] __se_sys_pwrite64 fs/read_write.c:798 [inline] __x64_sys_pwrite64+0x1eb/0x250 fs/read_write.c:798 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 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 kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x12a6/0x1ce0 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:598 [inline] __mutex_lock+0x193/0x1060 kernel/locking/mutex.c:760 hfs_find_init+0x1c3/0x240 fs/hfs/bfind.c:36 hfs_ext_read_extent+0x19b/0x9e0 fs/hfs/extent.c:200 hfs_get_block+0x55f/0x830 fs/hfs/extent.c:366 block_read_full_folio+0x457/0x850 fs/buffer.c:2420 filemap_read_folio+0xc8/0x2a0 mm/filemap.c:2413 do_read_cache_folio+0x263/0x5c0 mm/filemap.c:3957 do_read_cache_page mm/filemap.c:4023 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:4032 read_mapping_page include/linux/pagemap.h:985 [inline] __hfs_bnode_create+0x62d/0x8a0 fs/hfsplus/bnode.c:538 hfs_bnode_find+0x2dc/0xd50 fs/hfs/bnode.c:433 hfs_brec_find+0x2b1/0x540 fs/hfs/bfind.c:129 hfs_brec_read+0x26/0x120 fs/hfs/bfind.c:168 hfs_cat_find_brec+0xd8/0x2c0 fs/hfs/catalog.c:194 hfs_fill_super+0x47f/0x730 fs/hfs/super.c:350 get_tree_bdev_flags+0x38c/0x620 fs/super.c:1692 vfs_get_tree+0x8e/0x340 fs/super.c:1815 do_new_mount fs/namespace.c:3808 [inline] path_mount+0x1513/0x2000 fs/namespace.c:4123 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount fs/namespace.c:4324 [inline] __x64_sys_mount+0x28d/0x310 fs/namespace.c:4324 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 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.7.3311/19707: #0: ffff8880285ea0e0 (&type->s_umount_key#71/1){+.+.}-{4:4}, at: alloc_super+0x235/0xbd0 fs/super.c:345 #1: ffff8880567a00b0 (&tree->tree_lock#2){+.+.}-{4:4}, at: hfs_find_init+0x19c/0x240 fs/hfs/bfind.c:33 #2: ffff888031a3e278 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_get_block+0x553/0x830 fs/hfs/extent.c:365 stack backtrace: CPU: 1 UID: 0 PID: 19707 Comm: syz.7.3311 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x275/0x350 kernel/locking/lockdep.c:2043 check_noncircular+0x14c/0x170 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 kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x12a6/0x1ce0 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:598 [inline] __mutex_lock+0x193/0x1060 kernel/locking/mutex.c:760 hfs_find_init+0x1c3/0x240 fs/hfs/bfind.c:36 hfs_ext_read_extent+0x19b/0x9e0 fs/hfs/extent.c:200 hfs_get_block+0x55f/0x830 fs/hfs/extent.c:366 block_read_full_folio+0x457/0x850 fs/buffer.c:2420 filemap_read_folio+0xc8/0x2a0 mm/filemap.c:2413 do_read_cache_folio+0x263/0x5c0 mm/filemap.c:3957 do_read_cache_page mm/filemap.c:4023 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:4032 read_mapping_page include/linux/pagemap.h:985 [inline] __hfs_bnode_create+0x62d/0x8a0 fs/hfsplus/bnode.c:538 hfs_bnode_find+0x2dc/0xd50 fs/hfs/bnode.c:433 hfs_brec_find+0x2b1/0x540 fs/hfs/bfind.c:129 hfs_brec_read+0x26/0x120 fs/hfs/bfind.c:168 hfs_cat_find_brec+0xd8/0x2c0 fs/hfs/catalog.c:194 hfs_fill_super+0x47f/0x730 fs/hfs/super.c:350 get_tree_bdev_flags+0x38c/0x620 fs/super.c:1692 vfs_get_tree+0x8e/0x340 fs/super.c:1815 do_new_mount fs/namespace.c:3808 [inline] path_mount+0x1513/0x2000 fs/namespace.c:4123 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount fs/namespace.c:4324 [inline] __x64_sys_mount+0x28d/0x310 fs/namespace.c:4324 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f0d1059066a 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:00007f0d11354e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f0d11354ef0 RCX: 00007f0d1059066a RDX: 0000200000000180 RSI: 0000200000000000 RDI: 00007f0d11354eb0 RBP: 0000200000000180 R08: 00007f0d11354ef0 R09: 0000000001000012 R10: 0000000001000012 R11: 0000000000000246 R12: 0000200000000000 R13: 00007f0d11354eb0 R14: 0000000000000314 R15: 00002000000003c0 hfs: get root inode failed EXT4-fs error (device loop7): ext4_map_blocks:814: inode #15: block 4: comm syz.7.3311: lblock 4 mapped to illegal pblock 4 (length 1) EXT4-fs (loop7): Delayed block allocation failed for inode 15 at logical offset 4 with max blocks 1 with error 117 EXT4-fs (loop7): This should not happen!! Data will be lost