loop0: detected capacity change from 0 to 1024 ============================================ WARNING: possible recursive locking detected 6.2.0-rc1-syzkaller #0 Not tainted -------------------------------------------- syz-executor249/5062 is trying to acquire lock: ffff8880227c0108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x27b/0x9b0 fs/hfsplus/extents.c:260 but task is already holding lock: ffff8880227c1c08 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x205/0x10d0 fs/hfsplus/extents.c:576 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&HFSPLUS_I(inode)->extents_lock); lock(&HFSPLUS_I(inode)->extents_lock); *** DEADLOCK *** May be due to missing lock nesting notation 7 locks held by syz-executor249/5062: #0: ffff88801fdbc460 (sb_writers#9){.+.+}-{0:0}, at: do_renameat2+0x37f/0xc30 fs/namei.c:4866 #1: ffff8880227c1740 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #1: ffff8880227c1740 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: lock_rename+0x229/0x280 fs/namei.c:2990 #2: ffff8880227c1e00 (&sb->s_type->i_mutex_key#16){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #2: ffff8880227c1e00 (&sb->s_type->i_mutex_key#16){+.+.}-{3:3}, at: lock_two_nondirectories+0xf0/0x110 fs/inode.c:1121 #3: ffff8880227c24c0 (&sb->s_type->i_mutex_key#15/4){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #3: ffff8880227c24c0 (&sb->s_type->i_mutex_key#15/4){+.+.}-{3:3}, at: lock_two_nondirectories+0xd5/0x110 fs/inode.c:1123 #4: ffff88802997e998 (&sbi->vh_mutex){+.+.}-{3:3}, at: hfsplus_unlink+0x151/0x830 fs/hfsplus/dir.c:370 #5: ffff8880227c1c08 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x205/0x10d0 fs/hfsplus/extents.c:576 #6: ffff88802997e8f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_free+0xdd/0x500 fs/hfsplus/bitmap.c:182 stack backtrace: CPU: 0 PID: 5062 Comm: syz-executor249 Not tainted 6.2.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2990 [inline] check_deadlock kernel/locking/lockdep.c:3033 [inline] validate_chain kernel/locking/lockdep.c:3818 [inline] __lock_acquire.cold+0x116/0x3a7 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1360 kernel/locking/mutex.c:747 hfsplus_get_block+0x27b/0x9b0 fs/hfsplus/extents.c:260 block_read_full_folio+0x35b/0x9d0 fs/buffer.c:2271 filemap_read_folio+0xdb/0x2c0 mm/filemap.c:2426 do_read_cache_folio+0x1df/0x510 mm/filemap.c:3553 do_read_cache_page mm/filemap.c:3595 [inline] read_cache_page+0x5d/0x160 mm/filemap.c:3604 read_mapping_page include/linux/pagemap.h:755 [inline] hfsplus_block_free+0x13d/0x500 fs/hfsplus/bitmap.c:185 hfsplus_free_extents+0x1ff/0x4f0 fs/hfsplus/extents.c:363 hfsplus_file_truncate+0xe36/0x10d0 fs/hfsplus/extents.c:591 hfsplus_delete_inode+0x191/0x220 fs/hfsplus/inode.c:454 hfsplus_unlink+0x5a6/0x830 fs/hfsplus/dir.c:405 hfsplus_rename+0xc2/0x210 fs/hfsplus/dir.c:547 vfs_rename+0x1162/0x1a90 fs/namei.c:4779 do_renameat2+0xb22/0xc30 fs/namei.c:4930 __do_sys_renameat2 fs/namei.c:4963 [inline] __se_sys_renameat2 fs/namei.c:4960 [inline] __x64_sys_renameat2+0xe8/0x120 fs/namei.c:4960 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7efcc4682b79 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffdc7f4fd48 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007efcc4682b79 RDX: 0000000000000005 RSI: 00000000200001c0 RDI: 0000000000000005 RBP: 00007efcc4642180 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000020000200 R11: 0000000000000246 R12: 00007efcc4642210 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 hfsplus: request for non-existent node 31668 in B*Tree hfsplus: request for non-existent node 31668 in B*Tree hfsplus: request for non-existent node 31668 in B*Tree hfsplus: request for non-existent node 31668 in B*Tree hfsplus: request for non-existent node 31668 in B*Tree hfsplus: request for n