====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.5.1249/8950 is trying to acquire lock: ffff8880792093c0 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21c/0x1df0 fs/hfsplus/extents.c:457 but task is already holding lock: ffff88807ea5c0a8 (&tree->tree_lock#2/1){+.+.}-{4:4}, at: hfsplus_find_init+0x179/0x2e0 fs/hfsplus/bfind.c:29 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&tree->tree_lock#2/1){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19d/0x1550 kernel/locking/mutex.c:821 hfsplus_find_init+0x179/0x2e0 fs/hfsplus/bfind.c:29 hfsplus_file_truncate+0x3e0/0xd20 fs/hfsplus/extents.c:585 hfsplus_setattr+0x1b5/0x260 fs/hfsplus/inode.c:328 notify_change+0xbba/0xea0 fs/attr.c:556 do_truncate+0x1c2/0x250 fs/open.c:68 handle_truncate fs/namei.c:4300 [inline] do_open fs/namei.c:4841 [inline] path_openat+0x15b5/0x1d60 fs/namei.c:5000 do_file_open+0x23e/0x4a0 fs/namei.c:5029 do_sys_openat2+0x115/0x200 fs/open.c:1417 do_sys_open fs/open.c:1423 [inline] __do_sys_openat fs/open.c:1439 [inline] __se_sys_openat fs/open.c:1434 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1434 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3181 [inline] check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x15ff/0x2e50 kernel/locking/lockdep.c:5254 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5908 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19d/0x1550 kernel/locking/mutex.c:821 hfsplus_file_extend+0x21c/0x1df0 fs/hfsplus/extents.c:457 hfsplus_bmap_reserve+0x170/0x590 fs/hfsplus/btree.c:512 __hfsplus_ext_write_extent+0x295/0x690 fs/hfsplus/extents.c:104 __hfsplus_ext_cache_extent+0x81/0xbd0 fs/hfsplus/extents.c:190 hfsplus_ext_read_extent fs/hfsplus/extents.c:222 [inline] hfsplus_file_extend+0x502/0x1df0 fs/hfsplus/extents.c:461 hfsplus_get_block+0x41f/0x1610 fs/hfsplus/extents.c:249 get_more_blocks fs/direct-io.c:644 [inline] do_direct_IO fs/direct-io.c:932 [inline] __blockdev_direct_IO+0x1590/0x3380 fs/direct-io.c:1236 blockdev_direct_IO include/linux/fs.h:3155 [inline] hfsplus_direct_IO+0x21f/0x370 fs/hfsplus/inode.c:174 generic_file_direct_write+0x1d0/0x3f0 mm/filemap.c:4308 __generic_file_write_iter+0x11d/0x230 mm/filemap.c:4477 generic_file_write_iter+0xae/0x330 mm/filemap.c:4517 do_iter_readv_writev+0x612/0x8c0 fs/read_write.c:-1 vfs_writev+0x343/0x990 fs/read_write.c:1058 do_pwritev fs/read_write.c:1154 [inline] __do_sys_pwritev2 fs/read_write.c:1212 [inline] __se_sys_pwritev2+0x177/0x2a0 fs/read_write.c:1203 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&tree->tree_lock#2/1); lock(&HFSPLUS_I(inode)->extents_lock); lock(&tree->tree_lock#2/1); lock(&HFSPLUS_I(inode)->extents_lock); *** DEADLOCK *** locks held by syz.5.1249/8950: 4, last CPU#1: #0: ffff88807b174460 (sb_writers#28){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2753 [inline] #0: ffff88807b174460 (sb_writers#28){.+.+}-{0:0}, at: vfs_writev+0x2af/0x990 fs/read_write.c:1056 #1: ffff88807920bad8 (&sb->s_type->i_mutex_key#39){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1024 [inline] #1: ffff88807920bad8 (&sb->s_type->i_mutex_key#39){+.+.}-{4:4}, at: generic_file_write_iter+0x82/0x330 mm/filemap.c:4514 #2: ffff88807920b940 (&hip->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21c/0x1df0 fs/hfsplus/extents.c:457 #3: ffff88807ea5c0a8 (&tree->tree_lock#2/1){+.+.}-{4:4}, at: hfsplus_find_init+0x179/0x2e0 fs/hfsplus/bfind.c:29 stack backtrace: CPU: 1 UID: 0 PID: 8950 Comm: syz.5.1249 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/05/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e2/0x300 kernel/locking/lockdep.c:2059 check_noncircular+0x12f/0x150 kernel/locking/lockdep.c:2191 check_prev_add kernel/locking/lockdep.c:3181 [inline] check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x15ff/0x2e50 kernel/locking/lockdep.c:5254 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5908 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19d/0x1550 kernel/locking/mutex.c:821 hfsplus_file_extend+0x21c/0x1df0 fs/hfsplus/extents.c:457 hfsplus_bmap_reserve+0x170/0x590 fs/hfsplus/btree.c:512 __hfsplus_ext_write_extent+0x295/0x690 fs/hfsplus/extents.c:104 __hfsplus_ext_cache_extent+0x81/0xbd0 fs/hfsplus/extents.c:190 hfsplus_ext_read_extent fs/hfsplus/extents.c:222 [inline] hfsplus_file_extend+0x502/0x1df0 fs/hfsplus/extents.c:461 hfsplus_get_block+0x41f/0x1610 fs/hfsplus/extents.c:249 get_more_blocks fs/direct-io.c:644 [inline] do_direct_IO fs/direct-io.c:932 [inline] __blockdev_direct_IO+0x1590/0x3380 fs/direct-io.c:1236 blockdev_direct_IO include/linux/fs.h:3155 [inline] hfsplus_direct_IO+0x21f/0x370 fs/hfsplus/inode.c:174 generic_file_direct_write+0x1d0/0x3f0 mm/filemap.c:4308 __generic_file_write_iter+0x11d/0x230 mm/filemap.c:4477 generic_file_write_iter+0xae/0x330 mm/filemap.c:4517 do_iter_readv_writev+0x612/0x8c0 fs/read_write.c:-1 vfs_writev+0x343/0x990 fs/read_write.c:1058 do_pwritev fs/read_write.c:1154 [inline] __do_sys_pwritev2 fs/read_write.c:1212 [inline] __se_sys_pwritev2+0x177/0x2a0 fs/read_write.c:1203 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f7bccd9e159 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:00007f7bcdca1028 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007f7bcd025fa0 RCX: 00007f7bccd9e159 RDX: 0000000000000001 RSI: 0000200000000240 RDI: 0000000000000004 RBP: 00007f7bcce35024 R08: 0000000000000000 R09: 0000000000000003 R10: 0000000000002000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f7bcd026038 R14: 00007f7bcd025fa0 R15: 00007ffc8adf8af8