]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ntfs: use d_splice_alias() for ->lookup() return value
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 9 May 2026 16:30:19 +0000 (12:30 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 6 Jun 2026 21:12:21 +0000 (17:12 -0400)
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ntfs/namei.c

index c4f82846c58c30fec4d396cb015f0888ae611ded..3e21753b9f88648953eef7c63531a3de90d5f0f4 100644 (file)
@@ -230,9 +230,8 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent,
        if (MREF_ERR(mref) == -ENOENT) {
                ntfs_debug("Entry was not found, adding negative dentry.");
                /* The dcache will handle negative entries. */
-               d_add(dent, NULL);
                ntfs_debug("Done.");
-               return NULL;
+               return d_splice_alias(NULL, dent);
        }
        ntfs_error(vol->sb, "ntfs_lookup_ino_by_name() failed with error code %i.",
                        -MREF_ERR(mref));