loop1: detected capacity change from 0 to 64 ============================================ WARNING: possible recursive locking detected 5.15.158-syzkaller #0 Not tainted -------------------------------------------- syz-executor.1/21892 is trying to acquire lock: ffff888064d1a0b0 (&tree->tree_lock#2/1){+.+.}-{3:3}, at: hfs_find_init+0x16a/0x1e0 but task is already holding lock: ffff888064d1a0b0 (&tree->tree_lock#2/1){+.+.}-{3:3}, at: hfs_find_init+0x16a/0x1e0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&tree->tree_lock#2/1); lock(&tree->tree_lock#2/1); *** DEADLOCK *** May be due to missing lock nesting notation 5 locks held by syz-executor.1/21892: #0: ffff888079a10460 (sb_writers#31){.+.+}-{0:0}, at: do_sys_ftruncate+0x25a/0x390 fs/open.c:190 #1: ffff8880785ac3a8 (&sb->s_type->i_mutex_key#38){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline] #1: ffff8880785ac3a8 (&sb->s_type->i_mutex_key#38){+.+.}-{3:3}, at: do_truncate+0x208/0x300 fs/open.c:63 #2: ffff8880785ac1f8 (&HFS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xfb/0x1440 fs/hfs/extent.c:397 #3: ffff888064d1a0b0 (&tree->tree_lock#2/1){+.+.}-{3:3}, at: hfs_find_init+0x16a/0x1e0 #4: ffff88807df51478 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xfb/0x1440 fs/hfs/extent.c:397 stack backtrace: CPU: 0 PID: 21892 Comm: syz-executor.1 Not tainted 5.15.158-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2946 [inline] check_deadlock kernel/locking/lockdep.c:2989 [inline] validate_chain+0x46d2/0x5930 kernel/locking/lockdep.c:3775 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1da/0x25a0 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+0x16a/0x1e0 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_extend_file+0x317/0x1440 fs/hfs/extent.c:401 hfs_bmap_reserve+0xd5/0x3f0 fs/hfs/btree.c:231 __hfs_ext_write_extent+0x22e/0x4f0 fs/hfs/extent.c:121 __hfs_ext_cache_extent+0x6a/0x990 fs/hfs/extent.c:174 hfs_ext_read_extent fs/hfs/extent.c:202 [inline] hfs_extend_file+0x340/0x1440 fs/hfs/extent.c:401 hfs_get_block+0x3e0/0xb60 fs/hfs/extent.c:353 __block_write_begin_int+0x60b/0x1650 fs/buffer.c:2012 __block_write_begin fs/buffer.c:2062 [inline] block_write_begin fs/buffer.c:2122 [inline] cont_write_begin+0x5d6/0x840 fs/buffer.c:2471 hfs_write_begin+0x92/0xd0 fs/hfs/inode.c:59 cont_expand_zero fs/buffer.c:2398 [inline] cont_write_begin+0x2ad/0x840 fs/buffer.c:2461 hfs_write_begin+0x92/0xd0 fs/hfs/inode.c:59 hfs_file_truncate+0x1ed/0xa20 fs/hfs/extent.c:494 hfs_inode_setattr+0x45d/0x6a0 fs/hfs/inode.c:654 notify_change+0xc6d/0xf50 fs/attr.c:505 do_truncate+0x21c/0x300 fs/open.c:65 do_sys_ftruncate+0x2eb/0x390 fs/open.c:193 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f2e6e149d69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2e6c6bc0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000004d RAX: ffffffffffffffda RBX: 00007f2e6e277f80 RCX: 00007f2e6e149d69 RDX: 0000000000000000 RSI: 0000000002007fff RDI: 0000000000000005 RBP: 00007f2e6e19649e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f2e6e277f80 R15: 00007ffe3f9ecb38