loop0: detected capacity change from 0 to 64 ======================================================= WARNING: The mand mount option has been deprecated and and is ignored by this kernel. Remove the mand option from the mount to silence this warning. ======================================================= ============================================ WARNING: possible recursive locking detected 6.12.0-syzkaller-00971-g158f238aa69d #0 Not tainted -------------------------------------------- syz.0.0/5333 is trying to acquire lock: ffff8880367de0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x16e/0x1f0 but task is already holding lock: ffff8880367de0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x16e/0x1f0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&tree->tree_lock/1); lock(&tree->tree_lock/1); *** DEADLOCK *** May be due to missing lock nesting notation 5 locks held by syz.0.0/5333: #0: ffff8880367dc420 (sb_writers#11){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2964 [inline] #0: ffff8880367dc420 (sb_writers#11){.+.+}-{0:0}, at: vfs_write+0x225/0xd30 fs/read_write.c:675 #1: ffff888037a69ca0 (&sb->s_type->i_mutex_key#19){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:818 [inline] #1: ffff888037a69ca0 (&sb->s_type->i_mutex_key#19){+.+.}-{3:3}, at: generic_file_write_iter+0x82/0x310 mm/filemap.c:4180 #2: ffff888037a69af8 (&HFS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xff/0x1450 fs/hfs/extent.c:397 #3: ffff8880367de0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x16e/0x1f0 #4: ffff888037a680f8 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xff/0x1450 fs/hfs/extent.c:397 stack backtrace: CPU: 0 UID: 0 PID: 5333 Comm: syz.0.0 Not tainted 6.12.0-syzkaller-00971-g158f238aa69d #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3037 check_deadlock kernel/locking/lockdep.c:3089 [inline] validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3891 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 hfs_find_init+0x16e/0x1f0 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_extend_file+0x31b/0x1450 fs/hfs/extent.c:401 hfs_bmap_reserve+0xd9/0x400 fs/hfs/btree.c:234 __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+0x344/0x1450 fs/hfs/extent.c:401 hfs_get_block+0x3e4/0xb60 fs/hfs/extent.c:353 __block_write_begin_int+0x50c/0x1a70 fs/buffer.c:2122 block_write_begin fs/buffer.c:2232 [inline] cont_write_begin+0x6e2/0x9d0 fs/buffer.c:2583 hfs_write_begin+0x68/0xb0 fs/hfs/inode.c:52 cont_expand_zero fs/buffer.c:2510 [inline] cont_write_begin+0x338/0x9d0 fs/buffer.c:2573 hfs_write_begin+0x68/0xb0 fs/hfs/inode.c:52 generic_perform_write+0x344/0x6d0 mm/filemap.c:4056 generic_file_write_iter+0xae/0x310 mm/filemap.c:4183 new_sync_write fs/read_write.c:586 [inline] vfs_write+0xaeb/0xd30 fs/read_write.c:679 ksys_pwrite64 fs/read_write.c:786 [inline] __do_sys_pwrite64 fs/read_write.c:794 [inline] __se_sys_pwrite64 fs/read_write.c:791 [inline] __x64_sys_pwrite64+0x1ac/0x240 fs/read_write.c:791 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fd29b17e759 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd29becd038 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007fd29b335f80 RCX: 00007fd29b17e759 RDX: 0000000000000001 RSI: 0000000020000140 RDI: 0000000000000005 RBP: 00007fd29b1f175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000008000c61 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fd29b335f80 R15: 00007ffff9caa308