overlayfs: "xino" feature enabled using 3 upper inode bits.
overlayfs: "xino" feature enabled using 3 upper inode bits.
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.5.21/5993 is trying to acquire lock:
ffff8881a6839900 (&type->i_mutex_dir_key#4){++++}-{4:4}, at: lookup_slow+0x46/0x80

but task is already holding lock:
ffff8881bb9f9140 (DCACHE_PAR_LOOKUP){+.+.}-{0:0}, at: __d_alloc_parallel+0x39e/0x1700

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (DCACHE_PAR_LOOKUP){+.+.}-{0:0}:
       __d_alloc_parallel+0xc32/0x1700
       __lookup_slow+0x82/0x2f0
       lookup_slow+0x59/0x80
       path_lookupat+0x3f5/0x8c0
       filename_lookup+0x265/0x5d0
       do_readlinkat+0xe3/0x510
       __x64_sys_readlink+0x7f/0x90
       do_syscall_64+0x166/0x520
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&type->i_mutex_dir_key#4){++++}-{4:4}:
       __lock_acquire+0x164c/0x2de0
       lock_acquire+0x115/0x350
       down_read+0x45/0x320
       lookup_slow+0x46/0x80
       ovl_lookup_single+0x323/0xe90
       ovl_lookup_layer+0x377/0x440
       ovl_lookup+0x9ae/0x1c80
       __lookup_slow+0x1fb/0x2f0
       ovl_cache_update+0x2fc/0xb70
       ovl_iterate+0x66e/0x2160
       wrap_directory_iterator+0x96/0xe0
       iterate_dir+0x3db/0x880
       ovl_dir_read+0x141/0x4a0
       ovl_dir_read_merged+0x2fb/0x520
       ovl_iterate+0xd5a/0x2160
       wrap_directory_iterator+0x96/0xe0
       iterate_dir+0x3db/0x880
       __se_sys_getdents64+0xf1/0x280
       do_syscall_64+0x166/0x520
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(DCACHE_PAR_LOOKUP);
                               lock(&type->i_mutex_dir_key#4);
                               lock(DCACHE_PAR_LOOKUP);
  rlock(&type->i_mutex_dir_key#4);

 *** DEADLOCK ***

locks held by syz.5.21/5993: 4, last CPU#1:
 #0: ffff8881bfef1cf0 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x118/0x160
 #1: ffff8881a70fb298 (&ovl_i_mutex_dir_key[depth]#2){++++}-{4:4}, at: wrap_directory_iterator+0x5a/0xe0
 #2: ffff8881a70fcdf0 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: wrap_directory_iterator+0x5a/0xe0
 #3: ffff8881bb9f9140 (DCACHE_PAR_LOOKUP){+.+.}-{0:0}, at: __d_alloc_parallel+0x39e/0x1700

stack backtrace:
CPU: 1 UID: 0 PID: 5993 Comm: syz.5.21 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
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150
 print_circular_bug+0x2e2/0x300
 check_noncircular+0x12f/0x150
 __lock_acquire+0x164c/0x2de0
 lock_acquire+0x115/0x350
 down_read+0x45/0x320
 lookup_slow+0x46/0x80
 ovl_lookup_single+0x323/0xe90
 ovl_lookup_layer+0x377/0x440
 ovl_lookup+0x9ae/0x1c80
 __lookup_slow+0x1fb/0x2f0
 ovl_cache_update+0x2fc/0xb70
 ovl_iterate+0x66e/0x2160
 wrap_directory_iterator+0x96/0xe0
 iterate_dir+0x3db/0x880
 ovl_dir_read+0x141/0x4a0
 ovl_dir_read_merged+0x2fb/0x520
 ovl_iterate+0xd5a/0x2160
 wrap_directory_iterator+0x96/0xe0
 iterate_dir+0x3db/0x880
 __se_sys_getdents64+0xf1/0x280
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f980bd9e1d9
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:00007f980cc84028 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00007f980c025fa0 RCX: 00007f980bd9e1d9
RDX: 000000000000006d RSI: 0000200000008fc0 RDI: 0000000000000005
RBP: 00007f980be35888 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f980c026038 R14: 00007f980c025fa0 R15: 00007ffc94166048
 </TASK>
