summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQiujun Huang <hqjagain@gmail.com>2020-03-06 09:34:20 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-02 17:20:30 +0200
commit2a697f135bcbb9fe6020bf64d1a8e06052da7b4e (patch)
treee7b723f907bb7c5314de4c62680227f982bbd0a3
parentebf16d57c3300908f69d3af4a0879ea41681a601 (diff)
downloadlinux-stable-2a697f135bcbb9fe6020bf64d1a8e06052da7b4e.tar.gz
linux-stable-2a697f135bcbb9fe6020bf64d1a8e06052da7b4e.tar.bz2
linux-stable-2a697f135bcbb9fe6020bf64d1a8e06052da7b4e.zip
ceph: return ceph_mdsc_do_request() errors from __get_parent()
[ Upstream commit c6d50296032f0b97473eb2e274dc7cc5d0173847 ] 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: Qiujun Huang <hqjagain@gmail.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/ceph/export.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ceph/export.c b/fs/ceph/export.c
index fe02ae7f056a..ff9e60daf086 100644
--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -146,6 +146,11 @@ static struct dentry *__get_parent(struct super_block *sb,
}
req->r_num_caps = 1;
err = ceph_mdsc_do_request(mdsc, NULL, req);
+ if (err) {
+ ceph_mdsc_put_request(req);
+ return ERR_PTR(err);
+ }
+
inode = req->r_target_inode;
if (inode)
ihold(inode);