======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Tainted: G             L     
------------------------------------------------------
syz.5.556/8603 is trying to acquire lock:
ffff888119f78660 (&ocfs2_file_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_try_remove_refcount_tree+0xb6/0x340

but task is already holding lock:
ffff888119f786f8 (&oi->ip_xattr_sem){++++}-{4:4}, at: ocfs2_try_remove_refcount_tree+0xa4/0x340

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&oi->ip_xattr_sem){++++}-{4:4}:
       down_read+0x47/0x2e0
       ocfs2_init_acl+0x2fd/0x7e0
       ocfs2_mknod+0x1423/0x2210
       ocfs2_mkdir+0x181/0x430
       vfs_mkdir+0x511/0x5b0
       do_mkdirat+0x27d/0x4b0
       __x64_sys_mkdirat+0x87/0xa0
       do_syscall_64+0xe2/0xf80
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #2 (&journal->j_trans_barrier){.+.+}-{4:4}:
       down_read+0x47/0x2e0
       ocfs2_start_trans+0x3ab/0x700
       ocfs2_modify_bh+0xe3/0x4d0
       ocfs2_local_read_info+0x1454/0x1810
       dquot_load_quota_sb+0x791/0xbd0
       dquot_load_quota_inode+0x2e1/0x5d0
       ocfs2_enable_quotas+0x1c8/0x4a0
       ocfs2_fill_super+0x5337/0x6910
       get_tree_bdev_flags+0x431/0x4f0
       vfs_get_tree+0x92/0x2a0
       do_new_mount+0x329/0xa50
       __se_sys_mount+0x31d/0x420
       do_syscall_64+0xe2/0xf80
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #1 (sb_internal#5){.+.+}-{0:0}:
       ocfs2_start_trans+0x2ac/0x700
       ocfs2_truncate_file+0x631/0x1480
       ocfs2_setattr+0x15e5/0x1c70
       notify_change+0xc1a/0xf40
       do_truncate+0x1c2/0x250
       vfs_coredump+0x3712/0x4270
       get_signal+0x1107/0x1330
       arch_do_signal_or_restart+0xbc/0x830
       irqentry_exit+0x175/0x610
       asm_exc_page_fault+0x26/0x30

-> #0 (&ocfs2_file_ip_alloc_sem_key){++++}-{4:4}:
       __lock_acquire+0x15a5/0x2cf0
       lock_acquire+0x106/0x330
       down_write+0x96/0x200
       ocfs2_try_remove_refcount_tree+0xb6/0x340
       ocfs2_truncate_file+0xdf3/0x1480
       ocfs2_setattr+0x15e5/0x1c70
       notify_change+0xc1a/0xf40
       do_truncate+0x1c2/0x250
       vfs_coredump+0x3712/0x4270
       get_signal+0x1107/0x1330
       arch_do_signal_or_restart+0xbc/0x830
       irqentry_exit+0x175/0x610
       asm_exc_page_fault+0x26/0x30

other info that might help us debug this:

Chain exists of:
  &ocfs2_file_ip_alloc_sem_key --> &journal->j_trans_barrier --> &oi->ip_xattr_sem

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&oi->ip_xattr_sem);
                               lock(&journal->j_trans_barrier);
                               lock(&oi->ip_xattr_sem);
  lock(&ocfs2_file_ip_alloc_sem_key);

 *** DEADLOCK ***

2 locks held by syz.5.556/8603:
 #0: ffff888119f789c0 (&sb->s_type->i_mutex_key#40){+.+.}-{4:4}, at: do_truncate+0x18f/0x250
 #1: ffff888119f786f8 (&oi->ip_xattr_sem){++++}-{4:4}, at: ocfs2_try_remove_refcount_tree+0xa4/0x340

stack backtrace:
CPU: 0 UID: 0 PID: 8603 Comm: syz.5.556 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+0x15a5/0x2cf0
 lock_acquire+0x106/0x330
 down_write+0x96/0x200
 ocfs2_try_remove_refcount_tree+0xb6/0x340
 ocfs2_truncate_file+0xdf3/0x1480
 ocfs2_setattr+0x15e5/0x1c70
 notify_change+0xc1a/0xf40
 do_truncate+0x1c2/0x250
 vfs_coredump+0x3712/0x4270
 get_signal+0x1107/0x1330
 arch_do_signal_or_restart+0xbc/0x830
 irqentry_exit+0x175/0x610
 asm_exc_page_fault+0x26/0x30
RIP: 0033:0x0
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
RSP: 002b:0000200000000168 EFLAGS: 00010217
RAX: 0000000000000000 RBX: 00007f2f3b415fa0 RCX: 00007f2f3b19acb9
RDX: 00002000000001c0 RSI: 0000200000000160 RDI: 0000000000004000
RBP: 00007f2f3b208bf7 R08: 0000200000000240 R09: 0000200000000240
R10: 0000200000000200 R11: 0000000000000206 R12: 0000000000000000
R13: 00007f2f3b416038 R14: 00007f2f3b415fa0 R15: 00007ffdfcb113e8
 </TASK>
OCFS2: ERROR (device loop5): int ocfs2_validate_gd_parent(struct super_block *, struct ocfs2_dinode *, struct buffer_head *, int): Group descriptor #32 has bit count of 1024
On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted.
OCFS2: File system is now read-only.
(syz.5.556,8603,0):ocfs2_search_chain:1818 ERROR: status = -30
(syz.5.556,8603,0):ocfs2_search_chain:1941 ERROR: status = -30
(syz.5.556,8603,0):ocfs2_claim_suballoc_bits:2021 ERROR: status = -30
(syz.5.556,8603,0):ocfs2_claim_suballoc_bits:2074 ERROR: status = -30
(syz.5.556,8603,0):__ocfs2_claim_clusters:2449 ERROR: status = -30
(syz.5.556,8603,0):__ocfs2_claim_clusters:2457 ERROR: status = -30
(syz.5.556,8603,0):ocfs2_local_alloc_new_window:1199 ERROR: status = -30
(syz.5.556,8603,0):ocfs2_local_alloc_new_window:1224 ERROR: status = -30
(syz.5.556,8603,0):ocfs2_local_alloc_slide_window:1298 ERROR: status = -30
(syz.5.556,8603,0):ocfs2_local_alloc_slide_window:1317 ERROR: status = -30
(syz.5.556,8603,0):ocfs2_reserve_local_alloc_bits:672 ERROR: status = -30
(syz.5.556,8603,0):ocfs2_reserve_local_alloc_bits:710 ERROR: status = -30
(syz.5.556,8603,0):ocfs2_reserve_clusters_with_limit:1173 ERROR: status = -30
(syz.5.556,8603,1):ocfs2_reserve_clusters_with_limit:1222 ERROR: status = -30
(syz.5.556,8603,1):ocfs2_convert_inline_data_to_extents:7101 ERROR: status = -30
(syz.5.556,8603,1):ocfs2_try_to_write_inline_data:1544 ERROR: status = -30
(syz.5.556,8603,1):ocfs2_write_begin_nolock:1656 ERROR: status = -30
(syz.5.556,8603,1):ocfs2_write_begin:1887 ERROR: status = -30
syz.5.556 (8603) used greatest stack depth: 16584 bytes left
