loop0: detected capacity change from 0 to 1024 hfsplus: xattr searching failed ============================================ WARNING: possible recursive locking detected 6.2.0-rc3-next-20230112-syzkaller #0 Not tainted -------------------------------------------- syz-executor326/5089 is trying to acquire lock: ffff88802a0173c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x27b/0x9b0 fs/hfsplus/extents.c:260 but task is already holding lock: ffff888075dc8e88 (&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-executor326/5089: #0: ffff88807a992460 (sb_writers#9){.+.+}-{0:0}, at: do_open fs/namei.c:3551 [inline] #0: ffff88807a992460 (sb_writers#9){.+.+}-{0:0}, at: path_openat+0x19b8/0x2b40 fs/namei.c:3715 #1: ffff888075dc9080 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff888075dc9080 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: do_truncate+0x131/0x200 fs/open.c:64 #2: ffff888075dc8e88 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x205/0x10d0 fs/hfsplus/extents.c:576 #3: ffff88802bec98f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_free+0xdd/0x500 fs/hfsplus/bitmap.c:182 stack backtrace: CPU: 0 PID: 5089 Comm: syz-executor326 Not tainted 6.2.0-rc3-next-20230112-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:2991 [inline] check_deadlock kernel/locking/lockdep.c:3034 [inline] validate_chain kernel/locking/lockdep.c:3819 [inline] __lock_acquire.cold+0x149/0x425 kernel/locking/lockdep.c:5056 lock_acquire.part.0+0x11a/0x350 kernel/locking/lockdep.c:5669 __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+0x41d/0xab0 fs/buffer.c:2318 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:483 do_truncate+0x143/0x200 fs/open.c:66 handle_truncate fs/namei.c:3217 [inline] do_open fs/namei.c:3562 [inline] path_openat+0x2180/0x2b40 fs/namei.c:3715 do_filp_open+0x1ba/0x410 fs/namei.c:3742 do_sys_openat2+0x16d/0x4c0 fs/open.c:1311 do_sys_open fs/open.c:1327 [inline] __do_sys_creat fs/open.c:1403 [inline] __se_sys_creat fs/open.c:1397 [inline] __x64_sys_creat+0xcd/0x120 fs/open.c:1397 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:0x7fd4dd6f24f9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 71 15 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd4dd69e2f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007fd4dd777780 RCX: 00007fd4dd6f24f9 RDX: 00007fd4dd6f24f9 RSI: 0000000000000000 RDI: 0000000020000000 RBP: 00007fd4dd7440c0 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000005cd R11: 0000000000000246 R12: 0000000020000cc0 R13: 0031656c69662f2e R14: 0073756c70736668 R15: 00007fd4dd777788 hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent