loop8: detected capacity change from 0 to 1024 ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.8.1986/15453 is trying to acquire lock: ffff8880267a4880 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_get_block+0x2aa/0xab0 fs/hfsplus/extents.c:262 but task is already holding lock: ffff88802c8be0f0 (&sbi->alloc_mutex){+.+.}-{4:4}, at: hfsplus_block_allocate+0xd2/0xc90 fs/hfsplus/bitmap.c:35 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&sbi->alloc_mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:632 [inline] __mutex_lock+0x1a4/0x1b10 kernel/locking/mutex.c:806 hfsplus_block_allocate+0xd2/0xc90 fs/hfsplus/bitmap.c:35 hfsplus_file_extend+0x44e/0x1280 fs/hfsplus/extents.c:466 hfsplus_bmap_reserve+0x36a/0x4b0 fs/hfsplus/btree.c:510 hfsplus_create_cat+0x31f/0x12a0 fs/hfsplus/catalog.c:272 hfsplus_mknod+0x16e/0x450 fs/hfsplus/dir.c:538 lookup_open.isra.0+0xc47/0x11b0 fs/namei.c:4511 open_last_lookups fs/namei.c:4611 [inline] path_openat+0x2291/0x31a0 fs/namei.c:4855 do_file_open+0x20e/0x430 fs/namei.c:4887 do_sys_openat2+0x10d/0x1e0 fs/open.c:1364 do_sys_open fs/open.c:1370 [inline] __do_sys_openat fs/open.c:1386 [inline] __se_sys_openat fs/open.c:1381 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1381 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{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+0x14b8/0x2630 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x1b1/0x370 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:632 [inline] __mutex_lock+0x1a4/0x1b10 kernel/locking/mutex.c:806 hfsplus_get_block+0x2aa/0xab0 fs/hfsplus/extents.c:262 block_read_full_folio+0x36c/0x8e0 fs/buffer.c:2310 filemap_read_folio+0xfc/0x3b0 mm/filemap.c:2502 do_read_cache_folio+0x2d7/0x6b0 mm/filemap.c:4107 do_read_cache_page mm/filemap.c:4173 [inline] read_cache_page+0x5b/0x1b0 mm/filemap.c:4182 read_mapping_page include/linux/pagemap.h:1011 [inline] hfsplus_block_allocate+0x131/0xc90 fs/hfsplus/bitmap.c:37 hfsplus_file_extend+0x44e/0x1280 fs/hfsplus/extents.c:466 hfsplus_get_block+0x1a9/0xab0 fs/hfsplus/extents.c:247 __block_write_begin_int+0x57a/0x19c0 fs/buffer.c:2035 block_write_begin+0x9d/0x1d0 fs/buffer.c:2146 cont_write_begin+0x573/0xa10 fs/buffer.c:2484 hfsplus_write_begin+0x64/0x120 fs/hfsplus/inode.c:48 cont_expand_zero fs/buffer.c:2445 [inline] cont_write_begin+0x730/0xa10 fs/buffer.c:2474 hfsplus_write_begin+0x64/0x120 fs/hfsplus/inode.c:48 generic_perform_write+0x292/0xa40 mm/filemap.c:4325 __generic_file_write_iter+0x1f7/0x240 mm/filemap.c:4442 generic_file_write_iter+0xe1/0x3d0 mm/filemap.c:4468 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6ac/0x1070 fs/read_write.c:688 ksys_pwrite64 fs/read_write.c:795 [inline] __do_sys_pwrite64 fs/read_write.c:803 [inline] __se_sys_pwrite64 fs/read_write.c:800 [inline] __x64_sys_pwrite64+0x1eb/0x250 fs/read_write.c:800 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 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(&sbi->alloc_mutex); lock(&HFSPLUS_I(inode)->extents_lock); lock(&sbi->alloc_mutex); lock(&HFSPLUS_I(inode)->extents_lock); *** DEADLOCK *** 4 locks held by syz.8.1986/15453: #0: ffff88804a1e0410 (sb_writers#29){.+.+}-{0:0}, at: ksys_pwrite64 fs/read_write.c:795 [inline] #0: ffff88804a1e0410 (sb_writers#29){.+.+}-{0:0}, at: __do_sys_pwrite64 fs/read_write.c:803 [inline] #0: ffff88804a1e0410 (sb_writers#29){.+.+}-{0:0}, at: __se_sys_pwrite64 fs/read_write.c:800 [inline] #0: ffff88804a1e0410 (sb_writers#29){.+.+}-{0:0}, at: __x64_sys_pwrite64+0x1eb/0x250 fs/read_write.c:800 #1: ffff8880267a1ce8 (&sb->s_type->i_mutex_key#44){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1029 [inline] #1: ffff8880267a1ce8 (&sb->s_type->i_mutex_key#44){+.+.}-{4:4}, at: generic_file_write_iter+0x8c/0x3d0 mm/filemap.c:4465 #2: ffff8880267a1b00 (&hip->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1c9/0x1280 fs/hfsplus/extents.c:455 #3: ffff88802c8be0f0 (&sbi->alloc_mutex){+.+.}-{4:4}, at: hfsplus_block_allocate+0xd2/0xc90 fs/hfsplus/bitmap.c:35 stack backtrace: CPU: 0 UID: 0 PID: 15453 Comm: syz.8.1986 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/18/2026 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_circular_bug.cold+0x178/0x1c7 kernel/locking/lockdep.c:2043 check_noncircular+0x146/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 kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x14b8/0x2630 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x1b1/0x370 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:632 [inline] __mutex_lock+0x1a4/0x1b10 kernel/locking/mutex.c:806 hfsplus_get_block+0x2aa/0xab0 fs/hfsplus/extents.c:262 block_read_full_folio+0x36c/0x8e0 fs/buffer.c:2310 filemap_read_folio+0xfc/0x3b0 mm/filemap.c:2502 do_read_cache_folio+0x2d7/0x6b0 mm/filemap.c:4107 do_read_cache_page mm/filemap.c:4173 [inline] read_cache_page+0x5b/0x1b0 mm/filemap.c:4182 read_mapping_page include/linux/pagemap.h:1011 [inline] hfsplus_block_allocate+0x131/0xc90 fs/hfsplus/bitmap.c:37 hfsplus_file_extend+0x44e/0x1280 fs/hfsplus/extents.c:466 hfsplus_get_block+0x1a9/0xab0 fs/hfsplus/extents.c:247 __block_write_begin_int+0x57a/0x19c0 fs/buffer.c:2035 block_write_begin+0x9d/0x1d0 fs/buffer.c:2146 cont_write_begin+0x573/0xa10 fs/buffer.c:2484 hfsplus_write_begin+0x64/0x120 fs/hfsplus/inode.c:48 cont_expand_zero fs/buffer.c:2445 [inline] cont_write_begin+0x730/0xa10 fs/buffer.c:2474 hfsplus_write_begin+0x64/0x120 fs/hfsplus/inode.c:48 generic_perform_write+0x292/0xa40 mm/filemap.c:4325 __generic_file_write_iter+0x1f7/0x240 mm/filemap.c:4442 generic_file_write_iter+0xe1/0x3d0 mm/filemap.c:4468 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6ac/0x1070 fs/read_write.c:688 ksys_pwrite64 fs/read_write.c:795 [inline] __do_sys_pwrite64 fs/read_write.c:803 [inline] __se_sys_pwrite64 fs/read_write.c:800 [inline] __x64_sys_pwrite64+0x1eb/0x250 fs/read_write.c:800 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f07d639c819 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f07d72a6028 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007f07d6615fa0 RCX: 00007f07d639c819 RDX: 000000000000fdef RSI: 0000200000000140 RDI: 0000000000000004 RBP: 00007f07d6432c91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000e7c R11: 0000000000000246 R12: 0000000000000000 R13: 00007f07d6616038 R14: 00007f07d6615fa0 R15: 00007ffccb4acc08