From: Al Viro Date: Sat, 9 May 2026 16:31:57 +0000 (-0400) Subject: gfs2: use d_splice_alias() for ->lookup() return value X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2555ac7a450bf11f8e461ce6cd0f62613734a796;p=thirdparty%2Flinux.git gfs2: use d_splice_alias() for ->lookup() return value Reviewed-by: Andreas Gruenbacher Signed-off-by: Al Viro --- diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index e9bf4879c07f7..6a3581e3ba938 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -987,12 +987,8 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry, int error; inode = gfs2_lookupi(dir, &dentry->d_name, 0); - if (inode == NULL) { - d_add(dentry, NULL); - return NULL; - } - if (IS_ERR(inode)) - return ERR_CAST(inode); + if (inode == NULL || IS_ERR(inode)) + return d_splice_alias(inode, dentry); gl = GFS2_I(inode)->i_gl; error = gfs2_glock_nq_init(gl, LM_ST_SHARED, LM_FLAG_ANY, &gh);