linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/ceph: return errcode in __get_parent().
@ 2020-03-06  1:34 Qiujun Huang
  2020-03-06 12:13 ` Jeff Layton
  0 siblings, 1 reply; 2+ messages in thread
From: Qiujun Huang @ 2020-03-06  1:34 UTC (permalink / raw)
  To: jlayton; +Cc: sage, idryomov, ceph-devel, linux-kernel, Qiujun Huang

return real errcode when it's different from ENOENT.

Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
---
 fs/ceph/export.c | 5 +++++
 1 file changed, 5 insertions(+)

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);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs/ceph: return errcode in __get_parent().
  2020-03-06  1:34 [PATCH] fs/ceph: return errcode in __get_parent() Qiujun Huang
@ 2020-03-06 12:13 ` Jeff Layton
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Layton @ 2020-03-06 12:13 UTC (permalink / raw)
  To: Qiujun Huang; +Cc: sage, idryomov, ceph-devel, linux-kernel

On Fri, 2020-03-06 at 09:34 +0800, Qiujun Huang wrote:
> return real errcode when it's different from ENOENT.
> 
> Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
> ---
>  fs/ceph/export.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> 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);

Looks good! Merged into the ceph-client/testing branch and should make
5.7. Thanks for the patch!
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-06 12:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06  1:34 [PATCH] fs/ceph: return errcode in __get_parent() Qiujun Huang
2020-03-06 12:13 ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).