From: Qiujun Huang Date: Fri, 6 Mar 2020 01:34:20 +0000 (+0800) Subject: ceph: return ceph_mdsc_do_request() errors from __get_parent() X-Git-Tag: v5.4.36~155 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=acbfccc6a3e3d87bf9bc0ee545b941bb1a5ef9f1;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov Signed-off-by: Sasha Levin --- diff --git a/fs/ceph/export.c b/fs/ceph/export.c index b6bfa94..79dc068 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);