Commit 87b9d4e1 authored by Qiujun Huang's avatar Qiujun Huang Committed by Kleber Sacilotto de Souza

ceph: return ceph_mdsc_do_request() errors from __get_parent()

BugLink: https://bugs.launchpad.net/bugs/1878098

[ Upstream commit c6d50296 ]

Return the error returned by ceph_mdsc_do_request(). Otherwise,
r_target_inode ends up being NULL this ends up returning ENOENT
regardless of the error.
Signed-off-by: default avatarQiujun Huang <hqjagain@gmail.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 181a9bb9
...@@ -146,6 +146,11 @@ static struct dentry *__get_parent(struct super_block *sb, ...@@ -146,6 +146,11 @@ static struct dentry *__get_parent(struct super_block *sb,
} }
req->r_num_caps = 1; req->r_num_caps = 1;
err = ceph_mdsc_do_request(mdsc, NULL, req); err = ceph_mdsc_do_request(mdsc, NULL, req);
if (err) {
ceph_mdsc_put_request(req);
return ERR_PTR(err);
}
inode = req->r_target_inode; inode = req->r_target_inode;
if (inode) if (inode)
ihold(inode); ihold(inode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment