| From caca9db71813d037a6aaff03629e234c4d540564 Mon Sep 17 00:00:00 2001 |
| From: Qiujun Huang <hqjagain@gmail.com> |
| Date: Fri, 6 Mar 2020 09:34:20 +0800 |
| Subject: [PATCH] ceph: return ceph_mdsc_do_request() errors from |
| __get_parent() |
| |
| commit c6d50296032f0b97473eb2e274dc7cc5d0173847 upstream. |
| |
| 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: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/fs/ceph/export.c b/fs/ceph/export.c |
| index d3ef7ee429ec..07fd7192af68 100644 |
| --- a/fs/ceph/export.c |
| +++ b/fs/ceph/export.c |
| @@ -315,6 +315,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); |
| -- |
| 2.7.4 |
| |