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

but task is already holding lock:
ffff888118656c78 (&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_calc_xattr_init+0x20a/0xd90
       ocfs2_mknod+0xf51/0x2290
       ocfs2_create+0x195/0x490
       path_openat+0x1395/0x3860
       do_file_open+0x23e/0x4a0
       do_sys_openat2+0x113/0x200
       __x64_sys_openat+0x138/0x170
       do_syscall_64+0x14d/0xf80
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #2 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}:
       down_write+0x96/0x200
       ocfs2_evict_inode+0x1539/0x44e0
       evict+0x61e/0xb10
       vfs_rmdir+0x42a/0x6e0
       filename_rmdir+0x292/0x520
       __se_sys_unlinkat+0x71/0x1a0
       do_syscall_64+0x14d/0xf80
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #1 (&ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE]){+.+.}-{4:4}:
       down_write+0x96/0x200
       ocfs2_del_inode_from_orphan+0x12e/0x7a0
       ocfs2_dio_end_io+0x543/0x1210
       dio_complete+0x25b/0x790
       __blockdev_direct_IO+0x2e5d/0x34e0
       ocfs2_direct_IO+0x251/0x2c0
       generic_file_direct_write+0x1db/0x3e0
       __generic_file_write_iter+0x11d/0x230
       ocfs2_file_write_iter+0x1663/0x1ed0
       iter_file_splice_write+0x9a1/0x10f0
       direct_splice_actor+0x101/0x160
       splice_direct_to_actor+0x53a/0xc70
       do_splice_direct+0x195/0x290
       do_sendfile+0x535/0x7d0
       __se_sys_sendfile64+0x144/0x1a0
       do_syscall_64+0x14d/0xf80
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&ocfs2_file_ip_alloc_sem_key){++++}-{4:4}:
       __lock_acquire+0x15a5/0x2cf0
       lock_acquire+0xf0/0x2e0
       down_write+0x96/0x200
       ocfs2_try_remove_refcount_tree+0xb6/0x340
       ocfs2_truncate_file+0xdf3/0x1540
       ocfs2_setattr+0x15e5/0x1cc0
       notify_change+0xc1a/0xf40
       do_truncate+0x1c2/0x250
       vfs_coredump+0x371d/0x4280
       get_signal+0x1107/0x1330
       arch_do_signal_or_restart+0xbc/0x830
       irqentry_exit+0x176/0x620
       asm_exc_page_fault+0x26/0x30

other info that might help us debug this:

Chain exists of:
  &ocfs2_file_ip_alloc_sem_key --> &ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE] --> &oi->ip_xattr_sem

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&oi->ip_xattr_sem);
                               lock(&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]);
                               lock(&oi->ip_xattr_sem);
  lock(&ocfs2_file_ip_alloc_sem_key);

 *** DEADLOCK ***

2 locks held by syz.5.741/9149:
 #0: ffff888118656f40 (&sb->s_type->i_mutex_key#27){+.+.}-{4:4}, at: do_truncate+0x18f/0x250
 #1: ffff888118656c78 (&oi->ip_xattr_sem){++++}-{4:4}, at: ocfs2_try_remove_refcount_tree+0xa4/0x340

stack backtrace:
CPU: 0 UID: 0 PID: 9149 Comm: syz.5.741 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_write+0x96/0x200
 ocfs2_try_remove_refcount_tree+0xb6/0x340
 ocfs2_truncate_file+0xdf3/0x1540
 ocfs2_setattr+0x15e5/0x1cc0
 notify_change+0xc1a/0xf40
 do_truncate+0x1c2/0x250
 vfs_coredump+0x371d/0x4280
 get_signal+0x1107/0x1330
 arch_do_signal_or_restart+0xbc/0x830
 irqentry_exit+0x176/0x620
 asm_exc_page_fault+0x26/0x30
RIP: 0033:0x7f79c0c527f7
Code: e8 8e fa ff ff 89 f2 48 8d 3d 8d 40 1b 00 48 8d 35 6c fa 1d 00 31 c0 e8 e7 f8 ff ff 0f 1f 80 00 00 00 00 53 89 fb 48 83 ec 10 <64> 8b 04 25 a4 ff ff ff 85 c0 74 2a 89 fe 31 c0 bf 3c 00 00 00 e8
RSP: 002b:00007f79c1b6b0a0 EFLAGS: 00010206
RAX: 0000000000000000 RBX: 000000000000000b RCX: 00007f79c0d9c819
RDX: 00007f79c1b6b0c0 RSI: 00007f79c1b6b1f0 RDI: 000000000000000b
RBP: 00007f79c0e32c91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 00007f79c1016038 R14: 00007f79c1015fa0 R15: 00007ffc6d32fbe8
 </TASK>
bridge0: port 3(syz_tun) entered disabled state
syz_tun (unregistering): left allmulticast mode
syz_tun (unregistering): left promiscuous mode
bridge0: port 3(syz_tun) entered disabled state
ocfs2: Unmounting device (7,5) on (node local)
