JBD2: Ignoring recovery information on journal ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected 5.11.0-syzkaller #0 Not tainted ------------------------------------------------------ syz.0.15/4165 is trying to acquire lock: ffff88810ea1d5e0 (&oi->ip_alloc_sem){+.+.}-{3:3}, at: ocfs2_try_remove_refcount_tree+0x45/0x110 fs/ocfs2/refcounttree.c:933 but task is already holding lock: ffff88810ea1d678 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_try_remove_refcount_tree+0x3d/0x110 fs/ocfs2/refcounttree.c:932 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&oi->ip_xattr_sem){++++}-{3:3}: down_write+0x20/0x60 kernel/locking/rwsem.c:1406 ocfs2_xattr_set_handle+0x14a/0x280 fs/ocfs2/xattr.c:3499 ocfs2_init_security_set+0x1b/0x20 fs/ocfs2/xattr.c:7300 ocfs2_mknod+0xad3/0xfe0 fs/ocfs2/namei.c:413 ocfs2_create+0x51/0x1a0 fs/ocfs2/namei.c:672 lookup_open.isra.0+0x55e/0x6b0 fs/namei.c:3106 open_last_lookups fs/namei.c:3180 [inline] path_openat+0x29e/0xaa0 fs/namei.c:3368 do_filp_open+0x83/0x130 fs/namei.c:3398 do_sys_openat2+0x92/0x150 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_creat fs/open.c:1262 [inline] __se_sys_creat fs/open.c:1256 [inline] __x64_sys_creat+0x44/0x60 fs/open.c:1256 do_syscall_64+0x34/0x50 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #3 (jbd2_handle){++++}-{0:0}: start_this_handle+0x18c/0x540 fs/jbd2/transaction.c:446 jbd2__journal_start+0xf2/0x1a0 fs/jbd2/transaction.c:503 jbd2_journal_start+0x14/0x20 fs/jbd2/transaction.c:542 ocfs2_start_trans+0x176/0x360 fs/ocfs2/journal.c:356 ocfs2_block_group_alloc fs/ocfs2/suballoc.c:683 [inline] ocfs2_reserve_suballoc_bits+0x1bf/0x1960 fs/ocfs2/suballoc.c:830 ocfs2_reserve_new_metadata_blocks+0x1c7/0x390 fs/ocfs2/suballoc.c:980 ocfs2_mknod+0x4c8/0xfe0 fs/ocfs2/namei.c:342 ocfs2_create+0x51/0x1a0 fs/ocfs2/namei.c:672 lookup_open.isra.0+0x55e/0x6b0 fs/namei.c:3106 open_last_lookups fs/namei.c:3180 [inline] path_openat+0x29e/0xaa0 fs/namei.c:3368 do_filp_open+0x83/0x130 fs/namei.c:3398 do_sys_openat2+0x92/0x150 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_creat fs/open.c:1262 [inline] __se_sys_creat fs/open.c:1256 [inline] __x64_sys_creat+0x44/0x60 fs/open.c:1256 do_syscall_64+0x34/0x50 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #2 (&journal->j_trans_barrier){.+.+}-{3:3}: down_read+0x23/0xc0 kernel/locking/rwsem.c:1353 ocfs2_start_trans+0x16b/0x360 fs/ocfs2/journal.c:354 ocfs2_block_group_alloc fs/ocfs2/suballoc.c:683 [inline] ocfs2_reserve_suballoc_bits+0x1bf/0x1960 fs/ocfs2/suballoc.c:830 ocfs2_reserve_new_metadata_blocks+0x1c7/0x390 fs/ocfs2/suballoc.c:980 ocfs2_mknod+0x4c8/0xfe0 fs/ocfs2/namei.c:342 ocfs2_create+0x51/0x1a0 fs/ocfs2/namei.c:672 lookup_open.isra.0+0x55e/0x6b0 fs/namei.c:3106 open_last_lookups fs/namei.c:3180 [inline] path_openat+0x29e/0xaa0 fs/namei.c:3368 do_filp_open+0x83/0x130 fs/namei.c:3398 do_sys_openat2+0x92/0x150 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_creat fs/open.c:1262 [inline] __se_sys_creat fs/open.c:1256 [inline] __x64_sys_creat+0x44/0x60 fs/open.c:1256 do_syscall_64+0x34/0x50 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #1 (sb_internal#2){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1592 [inline] sb_start_intwrite include/linux/fs.h:1709 [inline] ocfs2_start_trans+0x109/0x360 fs/ocfs2/journal.c:352 ocfs2_orphan_for_truncate fs/ocfs2/file.c:394 [inline] ocfs2_truncate_file+0x130/0x870 fs/ocfs2/file.c:497 ocfs2_setattr+0x5cd/0xbe0 fs/ocfs2/file.c:1209 notify_change+0x33a/0x4b0 fs/attr.c:336 do_truncate+0x71/0xc0 fs/open.c:64 handle_truncate fs/namei.c:2912 [inline] do_open fs/namei.c:3258 [inline] path_openat+0x8f8/0xaa0 fs/namei.c:3371 do_filp_open+0x83/0x130 fs/namei.c:3398 do_sys_openat2+0x92/0x150 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_open fs/open.c:1196 [inline] __se_sys_open fs/open.c:1192 [inline] __x64_sys_open+0x50/0x90 fs/open.c:1192 do_syscall_64+0x34/0x50 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #0 (&oi->ip_alloc_sem){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:2868 [inline] check_prevs_add kernel/locking/lockdep.c:2993 [inline] validate_chain kernel/locking/lockdep.c:3608 [inline] __lock_acquire+0x114c/0x1b30 kernel/locking/lockdep.c:4832 lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0xc9/0x3f0 kernel/locking/lockdep.c:5407 down_write+0x20/0x60 kernel/locking/rwsem.c:1406 ocfs2_try_remove_refcount_tree+0x45/0x110 fs/ocfs2/refcounttree.c:933 ocfs2_setattr+0x5cd/0xbe0 fs/ocfs2/file.c:1209 notify_change+0x33a/0x4b0 fs/attr.c:336 do_truncate+0x71/0xc0 fs/open.c:64 handle_truncate fs/namei.c:2912 [inline] do_open fs/namei.c:3258 [inline] path_openat+0x8f8/0xaa0 fs/namei.c:3371 do_filp_open+0x83/0x130 fs/namei.c:3398 do_sys_openat2+0x92/0x150 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_open fs/open.c:1196 [inline] __se_sys_open fs/open.c:1192 [inline] __x64_sys_open+0x50/0x90 fs/open.c:1192 do_syscall_64+0x34/0x50 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 other info that might help us debug this: Chain exists of: &oi->ip_alloc_sem --> jbd2_handle --> &oi->ip_xattr_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&oi->ip_xattr_sem); lock(jbd2_handle); lock(&oi->ip_xattr_sem); lock(&oi->ip_alloc_sem); *** DEADLOCK *** 3 locks held by syz.0.15/4165: #0: ffff888114d6e448 (sb_writers#13){.+.+}-{0:0}, at: do_open fs/namei.c:3247 [inline] #0: ffff888114d6e448 (sb_writers#13){.+.+}-{0:0}, at: path_openat+0x84b/0xaa0 fs/namei.c:3371 #1: ffff88810ea1d948 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:773 [inline] #1: ffff88810ea1d948 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: do_truncate+0x64/0xc0 fs/open.c:62 #2: ffff88810ea1d678 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_try_remove_refcount_tree+0x3d/0x110 fs/ocfs2/refcounttree.c:932 stack backtrace: CPU: 1 PID: 4165 Comm: syz.0.15 Not tainted 5.11.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x77/0x97 lib/dump_stack.c:120 check_noncircular+0xcc/0xe0 kernel/locking/lockdep.c:2117 check_prev_add kernel/locking/lockdep.c:2868 [inline] check_prevs_add kernel/locking/lockdep.c:2993 [inline] validate_chain kernel/locking/lockdep.c:3608 [inline] __lock_acquire+0x114c/0x1b30 kernel/locking/lockdep.c:4832 lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0xc9/0x3f0 kernel/locking/lockdep.c:5407 down_write+0x20/0x60 kernel/locking/rwsem.c:1406 ocfs2_try_remove_refcount_tree+0x45/0x110 fs/ocfs2/refcounttree.c:933 ocfs2_setattr+0x5cd/0xbe0 fs/ocfs2/file.c:1209 notify_change+0x33a/0x4b0 fs/attr.c:336 do_truncate+0x71/0xc0 fs/open.c:64 handle_truncate fs/namei.c:2912 [inline] do_open fs/namei.c:3258 [inline] path_openat+0x8f8/0xaa0 fs/namei.c:3371 do_filp_open+0x83/0x130 fs/namei.c:3398 do_sys_openat2+0x92/0x150 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_open fs/open.c:1196 [inline] __se_sys_open fs/open.c:1192 [inline] __x64_sys_open+0x50/0x90 fs/open.c:1192 do_syscall_64+0x34/0x50 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f20c5dedef9 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:00007f20c586f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f20c5fa5f80 RCX: 00007f20c5dedef9 RDX: 0000000000000058 RSI: 0000000000121a03 RDI: 00000000200005c0 RBP: 00007f20c5e60b76 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f20c5fa5f80 R15: 00007ffed8320fd8