]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ecryptfs: use d_splice_alias() for ->lookup() return value
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 9 May 2026 16:28:48 +0000 (12:28 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 5 Jun 2026 05:12:15 +0000 (01:12 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ecryptfs/inode.c

index 546c1fe692c06a829afc3fedc26e40db3620415d..7aaf1913f9c6d3fe93e1272010402fb70cc4759f 100644 (file)
@@ -350,11 +350,9 @@ static struct dentry *ecryptfs_lookup_interpose(struct dentry *dentry,
         */
        lower_inode = READ_ONCE(lower_dentry->d_inode);
 
-       if (!lower_inode) {
-               /* We want to add because we couldn't find in lower */
-               d_add(dentry, NULL);
-               return NULL;
-       }
+       if (!lower_inode) /* We want to add because we couldn't find in lower */
+               return d_splice_alias(NULL, dentry);
+
        inode = __ecryptfs_get_inode(lower_inode, dentry->d_sb);
        if (IS_ERR(inode)) {
                printk(KERN_ERR "%s: Error interposing; rc = [%ld]\n",