loop0: detected capacity change from 0 to 1024 ============================================ WARNING: possible recursive locking detected 6.2.0-rc1-syzkaller-00095-ge4cf7c25bae5 #0 Not tainted -------------------------------------------- syz-executor675/5061 is trying to acquire lock: ffff88802a1f1548 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x27b/0x9b0 fs/hfsplus/extents.c:260 but task is already holding lock: ffff88802a1f2988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1bf/0xf60 fs/hfsplus/extents.c:457 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 4 locks held by syz-executor675/5061: #0: ffff88802a94e460 (sb_writers#9){.+.+}-{0:0}, at: do_pwritev+0x1b6/0x270 fs/read_write.c:1031 #1: ffff88802a1f2b80 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #1: ffff88802a1f2b80 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: generic_file_write_iter+0x92/0x350 mm/filemap.c:3929 #2: ffff88802a1f2988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1bf/0xf60 fs/hfsplus/extents.c:457 #3: ffff888077c720f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_allocate+0xe4/0x8c0 fs/hfsplus/bitmap.c:35 stack backtrace: CPU: 1 PID: 5061 Comm: syz-executor675 Not tainted 6.2.0-rc1-syzkaller-00095-ge4cf7c25bae5 #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_allocate+0x143/0x8c0 fs/hfsplus/bitmap.c:37 hfsplus_file_extend+0x43a/0xf60 fs/hfsplus/extents.c:468 hfsplus_get_block+0x1b3/0x9b0 fs/hfsplus/extents.c:245 __block_write_begin_int+0x3bd/0x14b0 fs/buffer.c:1991 __block_write_begin fs/buffer.c:2041 [inline] block_write_begin+0xb9/0x4d0 fs/buffer.c:2102 cont_write_begin+0x534/0x740 fs/buffer.c:2456 hfsplus_write_begin+0x87/0x150 fs/hfsplus/inode.c:52 cont_expand_zero fs/buffer.c:2383 [inline] cont_write_begin+0x334/0x740 fs/buffer.c:2446 hfsplus_write_begin+0x87/0x150 fs/hfsplus/inode.c:52 generic_perform_write+0x256/0x570 mm/filemap.c:3772 __generic_file_write_iter+0x2ae/0x500 mm/filemap.c:3900 generic_file_write_iter+0xe3/0x350 mm/filemap.c:3932 call_write_iter include/linux/fs.h:2186 [inline] do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735 do_iter_write+0x182/0x700 fs/read_write.c:861 vfs_writev+0x1aa/0x630 fs/read_write.c:934 do_pwritev+0x1b6/0x270 fs/read_write.c:1031 __do_sys_pwritev2 fs/read_write.c:1090 [inline] __se_sys_pwritev2 fs/read_write.c:1081 [inline] __x64_sys_pwritev2+0xef/0x150 fs/read_write.c:1081 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:0x7f043de75ab9 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:00007ffe4211b148 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f043de75ab9 RDX: 0000000000000001 RSI: 0000000020000200 RDI: 0000000000000004 RBP: 00007f043de350c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000005405 R11: 0000000000000246 R12: 00007f043de35150 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