diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2026-05-09 12:31:57 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2026-06-06 17:12:54 -0400 |
| commit | 2555ac7a450bf11f8e461ce6cd0f62613734a796 (patch) | |
| tree | 912e5aac53e27adb72cbe183ad3f5a2e7d1e9a2d /fs/gfs2 | |
| parent | 02975a536d4b1bb304c6c7e35ce0c861566c7af8 (diff) | |
| download | linux-next-2555ac7a450bf11f8e461ce6cd0f62613734a796.tar.gz linux-next-2555ac7a450bf11f8e461ce6cd0f62613734a796.zip | |
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>
Diffstat (limited to 'fs/gfs2')
| -rw-r--r-- | fs/gfs2/inode.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index e9bf4879c07f..6a3581e3ba93 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); |
