======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Tainted: G             L     
------------------------------------------------------
syz.2.489/8625 is trying to acquire lock:
ffff8881bab13ee8 (&oi->ip_xattr_sem){++++}-{4:4}, at: ocfs2_init_acl+0x2fd/0x7e0

but task is already holding lock:
ffff88816c4508e0 (&journal->j_trans_barrier){.+.+}-{4:4}, at: ocfs2_start_trans+0x3ab/0x700

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&journal->j_trans_barrier){.+.+}-{4:4}:
       down_read+0x47/0x2e0
       ocfs2_start_trans+0x3ab/0x700
       ocfs2_mknod+0x116a/0x2240
       ocfs2_create+0x195/0x460
       path_openat+0x17ba/0x3890
       do_file_open+0x23e/0x4a0
       do_sys_openat2+0x113/0x200
       __x64_sys_openat+0x138/0x170
       do_syscall_64+0x174/0x580
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #2 (sb_internal#4){.+.+}-{0:0}:
       ocfs2_start_trans+0x2ac/0x700
       ocfs2_xattr_set+0xe9c/0x13a0
       __vfs_setxattr+0x442/0x480
       __vfs_setxattr_noperm+0x12a/0x660
       vfs_setxattr+0x163/0x360
       filename_setxattr+0x296/0x630
       path_setxattrat+0x408/0x450
       __x64_sys_setxattr+0xbc/0xe0
       do_syscall_64+0x174/0x580
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #1 (&ocfs2_sysfile_lock_key[EXTENT_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}:
       down_write+0x96/0x200
       ocfs2_reserve_suballoc_bits+0x170/0x4850
       ocfs2_reserve_new_metadata_blocks+0x415/0x9a0
       ocfs2_init_xattr_set_ctxt+0x2f5/0x760
       ocfs2_xattr_set+0xc78/0x13a0
       __vfs_setxattr+0x442/0x480
       __vfs_setxattr_noperm+0x12a/0x660
       vfs_setxattr+0x163/0x360
       filename_setxattr+0x296/0x630
       path_setxattrat+0x408/0x450
       __x64_sys_setxattr+0xbc/0xe0
       do_syscall_64+0x174/0x580
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&oi->ip_xattr_sem){++++}-{4:4}:
       __lock_acquire+0x1520/0x2cd0
       lock_acquire+0x106/0x350
       down_read+0x47/0x2e0
       ocfs2_init_acl+0x2fd/0x7e0
       ocfs2_mknod+0x166a/0x2240
       ocfs2_create+0x195/0x460
       path_openat+0x17ba/0x3890
       do_file_open+0x23e/0x4a0
       filp_open+0x16d/0x1d0
       vfs_coredump+0x1fda/0x4510
       get_signal+0x1094/0x12c0
       arch_do_signal_or_restart+0xbb/0x860
       irqentry_exit+0x2aa/0x8e0
       asm_exc_page_fault+0x26/0x30

other info that might help us debug this:

Chain exists of:
  &oi->ip_xattr_sem --> sb_internal#4 --> &journal->j_trans_barrier

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  rlock(&journal->j_trans_barrier);
                               lock(sb_internal#4);
                               lock(&journal->j_trans_barrier);
  rlock(&oi->ip_xattr_sem);

 *** DEADLOCK ***

8 locks held by syz.2.489/8625:
 #0: ffff8881aa878410 (sb_writers#17){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90
 #1: ffff8881bab141a0 (&type->i_mutex_dir_key#10){++++}-{4:4}, at: path_openat+0xb5a/0x3890
 #2: ffff8881ae764fa0 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_suballoc_bits+0x170/0x4850
 #3: ffff8881ae765da0 (&ocfs2_sysfile_lock_key[EXTENT_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_suballoc_bits+0x170/0x4850
 #4: ffff8881ae7679a0 (&ocfs2_sysfile_lock_key[GLOBAL_BITMAP_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_suballoc_bits+0x170/0x4850
 #5: ffff8881aa878600 (sb_internal#4){.+.+}-{0:0}, at: ocfs2_mknod+0x116a/0x2240
 #6: ffff88816c4508e0 (&journal->j_trans_barrier){.+.+}-{4:4}, at: ocfs2_start_trans+0x3ab/0x700
 #7: ffff88816f50e938 (jbd2_handle#2){.+.+}-{0:0}, at: start_this_handle+0x1fc3/0x2210

stack backtrace:
CPU: 1 UID: 0 PID: 8625 Comm: syz.2.489 Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150
 print_circular_bug+0x2e1/0x300
 check_noncircular+0x12e/0x150
 __lock_acquire+0x1520/0x2cd0
 lock_acquire+0x106/0x350
 down_read+0x47/0x2e0
 ocfs2_init_acl+0x2fd/0x7e0
 ocfs2_mknod+0x166a/0x2240
 ocfs2_create+0x195/0x460
 path_openat+0x17ba/0x3890
 do_file_open+0x23e/0x4a0
 filp_open+0x16d/0x1d0
 vfs_coredump+0x1fda/0x4510
 get_signal+0x1094/0x12c0
 arch_do_signal_or_restart+0xbb/0x860
 irqentry_exit+0x2aa/0x8e0
 asm_exc_page_fault+0x26/0x30
RIP: 0033:0x0
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
RSP: 002b:0000200000000008 EFLAGS: 00010217
RAX: 0000000000000000 RBX: 00007f2392c15fa0 RCX: 00007f239299ce59
RDX: 0000000000000000 RSI: 0000200000000000 RDI: 0000000000000000
RBP: 00007f2392a32e6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f2392c16038 R14: 00007f2392c15fa0 R15: 00007ffe6ba987f8
 </TASK>
OCFS2: ERROR (device loop2): int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *, handle_t *, u32, u32, struct ocfs2_suballoc_result *): Chain allocator dinode 71 has 16777215 used bits but only 1024 total
On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted.
OCFS2: File system is now read-only.
(syz.2.489,8625,1):ocfs2_claim_suballoc_bits:2176 ERROR: status = -30
(syz.2.489,8625,1):__ocfs2_claim_clusters:2557 ERROR: status = -30
(syz.2.489,8625,0):__ocfs2_claim_clusters:2565 ERROR: status = -30
(syz.2.489,8625,0):ocfs2_convert_inline_data_to_extents:7146 ERROR: status = -30
(syz.2.489,8625,0):ocfs2_try_to_write_inline_data:1545 ERROR: status = -30
(syz.2.489,8625,0):ocfs2_write_begin_nolock:1657 ERROR: status = -30
(syz.2.489,8625,0):ocfs2_write_begin:1888 ERROR: status = -30
ocfs2: Unmounting device (7,2) on (node local)
