======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
kworker/u10:9/9146 is trying to acquire lock:
ffff8881aca0e9f8 (&ei->xattr_sem){++++}-{4:4}, at: ext4_destroy_inline_data+0x28/0xe0

but task is already holding lock:
ffff88811dde6b98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages+0x1cc/0x350

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&sbi->s_writepages_rwsem){++++}-{0:0}:
       lock_acquire+0x120/0x360
       percpu_down_read_internal+0x48/0x1c0
       ext4_writepages+0x1cc/0x350
       do_writepages+0x32e/0x550
       __writeback_single_inode+0x145/0xff0
       writeback_single_inode+0x1f9/0x6a0
       write_inode_now+0x160/0x1d0
       iput+0x830/0xc50
       ext4_xattr_block_set+0x1fce/0x2ac0
       ext4_expand_extra_isize_ea+0x12da/0x1ea0
       __ext4_expand_extra_isize+0x30d/0x400
       __ext4_mark_inode_dirty+0x46c/0x700
       ext4_evict_inode+0x80d/0xee0
       evict+0x504/0x9c0
       ext4_orphan_cleanup+0xc20/0x1460
       ext4_fill_super+0x5920/0x61e0
       get_tree_bdev_flags+0x40e/0x4d0
       vfs_get_tree+0x92/0x2b0
       do_new_mount+0x302/0xa10
       __se_sys_mount+0x313/0x410
       do_syscall_64+0xfa/0xfa0
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&ei->xattr_sem){++++}-{4:4}:
       validate_chain+0xb9b/0x2140
       __lock_acquire+0xab9/0xd20
       lock_acquire+0x120/0x360
       down_write+0x96/0x1f0
       ext4_destroy_inline_data+0x28/0xe0
       ext4_do_writepages+0x526/0x4610
       ext4_writepages+0x205/0x350
       do_writepages+0x32e/0x550
       __writeback_single_inode+0x145/0xff0
       writeback_sb_inodes+0x6c7/0x1010
       wb_writeback+0x43b/0xaf0
       wb_workfn+0x409/0xef0
       process_scheduled_works+0xae1/0x17b0
       worker_thread+0x8a0/0xda0
       kthread+0x711/0x8a0
       ret_from_fork+0x4bc/0x870
       ret_from_fork_asm+0x1a/0x30

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  rlock(&sbi->s_writepages_rwsem);
                               lock(&ei->xattr_sem);
                               lock(&sbi->s_writepages_rwsem);
  lock(&ei->xattr_sem);

 *** DEADLOCK ***

3 locks held by kworker/u10:9/9146:
 #0: ffff88816229e948 ((wq_completion)writeback){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc900017e7ba0 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffff88811dde6b98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages+0x1cc/0x350

stack backtrace:
CPU: 0 UID: 0 PID: 9146 Comm: kworker/u10:9 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Workqueue: writeback wb_workfn (flush-7:1)
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250
 print_circular_bug+0x2ee/0x310
 check_noncircular+0x134/0x160
 validate_chain+0xb9b/0x2140
 __lock_acquire+0xab9/0xd20
 lock_acquire+0x120/0x360
 down_write+0x96/0x1f0
 ext4_destroy_inline_data+0x28/0xe0
 ext4_do_writepages+0x526/0x4610
 ext4_writepages+0x205/0x350
 do_writepages+0x32e/0x550
 __writeback_single_inode+0x145/0xff0
 writeback_sb_inodes+0x6c7/0x1010
 wb_writeback+0x43b/0xaf0
 wb_workfn+0x409/0xef0
 process_scheduled_works+0xae1/0x17b0
 worker_thread+0x8a0/0xda0
 kthread+0x711/0x8a0
 ret_from_fork+0x4bc/0x870
 ret_from_fork_asm+0x1a/0x30
 </TASK>
EXT4-fs error (device loop1): ext4_validate_block_bitmap:432: comm kworker/u10:9: bg 0: block 5: invalid block bitmap
EXT4-fs (loop1): Delayed block allocation failed for inode 18 at logical offset 0 with max blocks 5 with error 28
EXT4-fs (loop1): This should not happen!! Data will be lost

EXT4-fs (loop1): Total free blocks count 0
EXT4-fs (loop1): Free/Dirty block details
EXT4-fs (loop1): free_blocks=0
EXT4-fs (loop1): dirty_blocks=16001
EXT4-fs (loop1): Block reservation details
EXT4-fs (loop1): i_reserved_data_blocks=16001
