loop0: detected capacity change from 0 to 1024 hfsplus: xattr searching failed ============================================ WARNING: possible recursive locking detected 6.2.0-rc1-syzkaller-00095-ge4cf7c25bae5 #0 Not tainted -------------------------------------------- syz-executor365/5062 is trying to acquire lock: ffff88801de81548 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x27b/0x9b0 fs/hfsplus/extents.c:260 but task is already holding lock: ffff888028e50108 (&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 4 locks held by syz-executor365/5062: #0: ffff88802a72a460 (sb_writers#9){.+.+}-{0:0}, at: do_open fs/namei.c:3550 [inline] #0: ffff88802a72a460 (sb_writers#9){.+.+}-{0:0}, at: path_openat+0x19b3/0x2a50 fs/namei.c:3714 #1: ffff888028e50300 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #1: ffff888028e50300 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: do_truncate+0x131/0x200 fs/open.c:63 #2: ffff888028e50108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x205/0x10d0 fs/hfsplus/extents.c:576 #3: ffff88802a3200f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_free+0xdd/0x500 fs/hfsplus/bitmap.c:182 stack backtrace: CPU: 1 PID: 5062 Comm: syz-executor365 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_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_setattr+0x1f2/0x320 fs/hfsplus/inode.c:269 notify_change+0xca7/0x1420 fs/attr.c:482 do_truncate+0x143/0x200 fs/open.c:65 handle_truncate fs/namei.c:3216 [inline] do_open fs/namei.c:3561 [inline] path_openat+0x2157/0x2a50 fs/namei.c:3714 do_filp_open+0x1ba/0x410 fs/namei.c:3741 do_sys_openat2+0x16d/0x4c0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_creat fs/open.c:1402 [inline] __se_sys_creat fs/open.c:1396 [inline] __x64_sys_creat+0xcd/0x120 fs/open.c:1396 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:0x7f41d4aee759 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:00007ffcc7020138 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 0031656c69662f2e RCX: 00007f41d4aee759 RDX: 00007f41d4aacdd3 RSI: 0000000000000000 RDI: 0000000020000080 RBP: 00007f41d4aadff0 R08: 00000000000005cd R09: 0000000000000000