xfs_vn_unlink() uses d_invalidate() on the dentry of a removed name on a case-insensitive filesystem, so that d_delete() doesn't leave a negative dentry behind. The next create() would otherwise reuse with the wrong spelling. But as the comment already states all it wants is the unhash. But d_invalidate() is the wrong primitive for that. It's for a name that went stale. It walks the subtree, prunes it and detaches every mount it finds, under namespace_sem, and here that runs from inside the filesystem's own directory operation. There is nothing below a file or an empty directory to prune, and vfs_unlink() and vfs_rmdir() detach the mounts a few lines later as for every other filesystem. The previous patch moved ext4, f2fs and tmpfs over to d_delete() unhashing the dentry for them. ascii-ci doesn't set S_CASEFOLD, so the VFS can't tell these directories apart, and the feature is deprecated anyway. So just d_drop() the dentry. d_delete() finds it unhashed and turns it negative without hashing it, exactly as before. Signed-off-by: Christian Brauner (Amutable) --- fs/xfs/xfs_iops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index d307ec97fac8..bed8372e4bcb 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -416,10 +416,10 @@ xfs_vn_unlink( /* * With unlink, the VFS makes the dentry "negative": no inode, * but still hashed. This is incompatible with case-insensitive - * mode, so invalidate (unhash) the dentry in CI-mode. + * mode, so unhash the dentry in CI-mode. */ if (xfs_has_asciici(XFS_M(dir->i_sb))) - d_invalidate(dentry); + d_drop(dentry); return 0; } -- 2.53.0