gfs2: use d_splice_alias() for ->lookup() return value

Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2026-05-09 12:31:57 -04:00
parent 02975a536d
commit 2555ac7a45

View File

@ -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);