Re: [syzbot] [ext4?] INFO: task hung in vfs_rmdir (2)

From: Hillf Danton
Date: Mon Jun 03 2024 - 06:42:48 EST


On Sun, 02 Jun 2024 20:50:18 -0700
> syzbot found the following issue on:
>
> HEAD commit: 4a4be1ad3a6e Revert "vfs: Delete the associated dentry whe..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=103820f2980000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

--- x/fs/namei.c
+++ y/fs/namei.c
@@ -4198,6 +4198,8 @@ int vfs_rmdir(struct mnt_idmap *idmap, s

if (!dir->i_op->rmdir)
return -EPERM;
+ if (dir == dentry->d_inode)
+ return -EDEADLK;

dget(dentry);
inode_lock(dentry->d_inode);
--