ocfs2: Mounting device (7,7) on (node local, slot 0) with ordered data mode.
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Tainted: G             L     
------------------------------------------------------
syz.7.3501/22588 is trying to acquire lock:
ffff8881afc34f78 (&oi->ip_xattr_sem){++++}-{4:4}, at: ocfs2_init_acl+0x2fd/0x7e0

but task is already holding lock:
ffff8881b97e30e8 (&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_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+0x5305/0x6900
       get_tree_bdev_flags+0x431/0x4f0
       vfs_get_tree+0x92/0x2a0
       do_new_mount+0x341/0xd30
       __se_sys_mount+0x31d/0x420
       do_syscall_64+0x14d/0xf80
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #2 (sb_internal#6){.+.+}-{0:0}:
       ocfs2_start_trans+0x2ac/0x700
       ocfs2_remove_btree_range+0x84c/0x1610
       ocfs2_commit_truncate+0xbc9/0x2340
       ocfs2_truncate_file+0xcf5/0x1540
       ocfs2_setattr+0x15e5/0x1cc0
       notify_change+0xc1a/0xf40
       do_truncate+0x1c2/0x250
       vfs_truncate+0x4b4/0x540
       do_sys_truncate+0xf3/0x1c0
       __x64_sys_truncate+0x5b/0x70
       do_syscall_64+0x14d/0xf80
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #1 (&ocfs2_sysfile_lock_key[TRUNCATE_LOG_SYSTEM_INODE]){+.+.}-{4:4}:
       down_write+0x96/0x200
       ocfs2_xattr_set+0xba7/0x13e0
       ocfs2_set_acl+0x701/0x7b0
       ocfs2_iop_set_acl+0x1b1/0x2b0
       vfs_set_acl+0x8ff/0xc00
       do_set_acl+0xf5/0x190
       filename_setxattr+0x305/0x630
       path_setxattrat+0x3eb/0x440
       __x64_sys_setxattr+0xbc/0xe0
       do_syscall_64+0x14d/0xf80
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&oi->ip_xattr_sem){++++}-{4:4}:
       __lock_acquire+0x15a5/0x2cf0
       lock_acquire+0xf0/0x2e0
       down_read+0x47/0x2e0
       ocfs2_init_acl+0x2fd/0x7e0
       ocfs2_mknod+0x1679/0x2290
       ocfs2_create+0x195/0x490
       path_openat+0x1395/0x3860
       do_file_open+0x23e/0x4a0
       do_sys_openat2+0x113/0x200
       __x64_sys_creat+0x8f/0xc0
       do_syscall_64+0x14d/0xf80
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

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

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

8 locks held by syz.7.3501/22588:
 #0: ffff88816e85c420 (sb_writers#12){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90
 #1: ffff8881afc35240 (&type->i_mutex_dir_key#23){++++}-{4:4}, at: path_openat+0xb4c/0x3860
 #2: ffff8881afdd1840 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_suballoc_bits+0x16a/0x4940
 #3: ffff8881afc343c0 (&ocfs2_sysfile_lock_key[EXTENT_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_suballoc_bits+0x16a/0x4940
 #4: ffff8881be6d09c0 (&ocfs2_sysfile_lock_key[LOCAL_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_local_alloc_bits+0x11f/0x26f0
 #5: ffff88816e85c610 (sb_internal#6){.+.+}-{0:0}, at: ocfs2_mknod+0x1181/0x2290
 #6: ffff8881b97e30e8 (&journal->j_trans_barrier){.+.+}-{4:4}, at: ocfs2_start_trans+0x3ab/0x700
 #7: ffff88819f08a950 (jbd2_handle#2){.+.+}-{0:0}, at: start_this_handle+0x2054/0x2290

stack backtrace:
CPU: 1 UID: 0 PID: 22588 Comm: syz.7.3501 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+0xf0/0x2e0
 down_read+0x47/0x2e0
 ocfs2_init_acl+0x2fd/0x7e0
 ocfs2_mknod+0x1679/0x2290
 ocfs2_create+0x195/0x490
 path_openat+0x1395/0x3860
 do_file_open+0x23e/0x4a0
 do_sys_openat2+0x113/0x200
 __x64_sys_creat+0x8f/0xc0
 do_syscall_64+0x14d/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fad45f9c799
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fad46eed028 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007fad46216090 RCX: 00007fad45f9c799
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 00002000000002c0
RBP: 00007fad46032bd9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fad46216128 R14: 00007fad46216090 R15: 00007ffdc8abbda8
 </TASK>
OCFS2: ERROR (device loop7): 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.7.3501,22588,1):ocfs2_claim_suballoc_bits:2151 ERROR: status = -30
(syz.7.3501,22588,1):__ocfs2_claim_clusters:2532 ERROR: status = -30
(syz.7.3501,22588,1):__ocfs2_claim_clusters:2540 ERROR: status = -30
(syz.7.3501,22588,1):ocfs2_local_alloc_new_window:1197 ERROR: status = -30
(syz.7.3501,22588,1):ocfs2_local_alloc_new_window:1222 ERROR: status = -30
(syz.7.3501,22588,1):ocfs2_local_alloc_slide_window:1296 ERROR: status = -30
(syz.7.3501,22588,1):ocfs2_local_alloc_slide_window:1315 ERROR: status = -30
(syz.7.3501,22588,1):ocfs2_reserve_local_alloc_bits:672 ERROR: status = -30
(syz.7.3501,22588,1):ocfs2_reserve_local_alloc_bits:710 ERROR: status = -30
(syz.7.3501,22588,1):ocfs2_reserve_clusters_with_limit:1241 ERROR: status = -30
(syz.7.3501,22588,1):ocfs2_reserve_clusters_with_limit:1290 ERROR: status = -30
(syz.7.3501,22588,1):ocfs2_convert_inline_data_to_extents:7101 ERROR: status = -30
(syz.7.3501,22588,1):ocfs2_try_to_write_inline_data:1543 ERROR: status = -30
(syz.7.3501,22588,1):ocfs2_write_begin_nolock:1655 ERROR: status = -30
(syz.7.3501,22588,1):ocfs2_write_begin:1886 ERROR: status = -30
