F2FS-fs (loop2): Mounted with checkpoint version = 753bd00b ====================================================== WARNING: possible circular locking dependency detected 6.5.0-syzkaller-04808-g6c1b980a7e79 #0 Not tainted ------------------------------------------------------ syz-executor.2/5499 is trying to acquire lock: ffff88803422e768 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline] ffff88803422e768 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_add_inline_entry+0x300/0x6f0 fs/f2fs/inline.c:644 but task is already holding lock: ffff88803422f9c8 (&fi->i_xattr_sem){++++}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline] ffff88803422f9c8 (&fi->i_xattr_sem){++++}-{3:3}, at: f2fs_add_dentry+0x92/0x230 fs/f2fs/dir.c:783 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&fi->i_xattr_sem){++++}-{3:3}: down_read+0x9c/0x470 kernel/locking/rwsem.c:1520 f2fs_down_read fs/f2fs/f2fs.h:2108 [inline] f2fs_getxattr+0xb1e/0x12c0 fs/f2fs/xattr.c:532 __f2fs_get_acl+0x5a/0x900 fs/f2fs/acl.c:179 f2fs_acl_create fs/f2fs/acl.c:377 [inline] f2fs_init_acl+0x15c/0xb30 fs/f2fs/acl.c:420 f2fs_init_inode_metadata+0x159/0x1290 fs/f2fs/dir.c:558 f2fs_add_regular_entry+0x79e/0xb90 fs/f2fs/dir.c:740 f2fs_add_dentry+0x1de/0x230 fs/f2fs/dir.c:788 f2fs_do_add_link+0x190/0x280 fs/f2fs/dir.c:827 f2fs_add_link fs/f2fs/f2fs.h:3556 [inline] f2fs_mkdir+0x377/0x620 fs/f2fs/namei.c:781 vfs_mkdir+0x532/0x7e0 fs/namei.c:4120 do_mkdirat+0x2a9/0x330 fs/namei.c:4143 __do_sys_mkdirat fs/namei.c:4158 [inline] __se_sys_mkdirat fs/namei.c:4156 [inline] __x64_sys_mkdirat+0x115/0x170 fs/namei.c:4156 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&fi->i_sem){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 down_write+0x93/0x200 kernel/locking/rwsem.c:1573 f2fs_down_write fs/f2fs/f2fs.h:2133 [inline] f2fs_add_inline_entry+0x300/0x6f0 fs/f2fs/inline.c:644 f2fs_add_dentry+0xa6/0x230 fs/f2fs/dir.c:784 f2fs_do_add_link+0x190/0x280 fs/f2fs/dir.c:827 f2fs_add_link fs/f2fs/f2fs.h:3556 [inline] f2fs_create+0x3b3/0x650 fs/f2fs/namei.c:377 lookup_open.isra.0+0x1049/0x1360 fs/namei.c:3495 open_last_lookups fs/namei.c:3563 [inline] path_openat+0x931/0x29c0 fs/namei.c:3793 do_filp_open+0x1de/0x430 fs/namei.c:3823 do_sys_openat2+0x176/0x1e0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1448 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&fi->i_xattr_sem); lock(&fi->i_sem); lock(&fi->i_xattr_sem); lock(&fi->i_sem); *** DEADLOCK *** 4 locks held by syz-executor.2/5499: #0: ffff88811a226410 (sb_writers#14){.+.+}-{0:0}, at: open_last_lookups fs/namei.c:3552 [inline] #0: ffff88811a226410 (sb_writers#14){.+.+}-{0:0}, at: path_openat+0x197e/0x29c0 fs/namei.c:3793 #1: ffff88803422f350 (&type->i_mutex_dir_key#10){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:802 [inline] #1: ffff88803422f350 (&type->i_mutex_dir_key#10){+.+.}-{3:3}, at: open_last_lookups fs/namei.c:3560 [inline] #1: ffff88803422f350 (&type->i_mutex_dir_key#10){+.+.}-{3:3}, at: path_openat+0x8c9/0x29c0 fs/namei.c:3793 #2: ffff8880329003b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline] #2: ffff8880329003b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_lock_op fs/f2fs/f2fs.h:2151 [inline] #2: ffff8880329003b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_create+0x2d7/0x650 fs/f2fs/namei.c:376 #3: ffff88803422f9c8 (&fi->i_xattr_sem){++++}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline] #3: ffff88803422f9c8 (&fi->i_xattr_sem){++++}-{3:3}, at: f2fs_add_dentry+0x92/0x230 fs/f2fs/dir.c:783 stack backtrace: CPU: 0 PID: 5499 Comm: syz-executor.2 Not tainted 6.5.0-syzkaller-04808-g6c1b980a7e79 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x311/0x3f0 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 down_write+0x93/0x200 kernel/locking/rwsem.c:1573 f2fs_down_write fs/f2fs/f2fs.h:2133 [inline] f2fs_add_inline_entry+0x300/0x6f0 fs/f2fs/inline.c:644 f2fs_add_dentry+0xa6/0x230 fs/f2fs/dir.c:784 f2fs_do_add_link+0x190/0x280 fs/f2fs/dir.c:827 f2fs_add_link fs/f2fs/f2fs.h:3556 [inline] f2fs_create+0x3b3/0x650 fs/f2fs/namei.c:377 lookup_open.isra.0+0x1049/0x1360 fs/namei.c:3495 open_last_lookups fs/namei.c:3563 [inline] path_openat+0x931/0x29c0 fs/namei.c:3793 do_filp_open+0x1de/0x430 fs/namei.c:3823 do_sys_openat2+0x176/0x1e0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1448 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fb736e7cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb737c0c0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fb736f9bf80 RCX: 00007fb736e7cae9 RDX: 0000000000000042 RSI: 0000000020020700 RDI: ffffffffffffff9c RBP: 00007fb736ec847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000180 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fb736f9bf80 R15: 00007ffceefcbcc8