Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1265541 > unrolled thread

Re: [PATCH] ceph:Fix error handling in the function ceph_readddir_prepopulate

Started by"Yan, Zheng" <zyan@redhat.com>
First post2015-11-09 11:30 +0100
Last post2015-11-09 11:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] ceph:Fix error handling in the function ceph_readddir_prepopulate "Yan, Zheng" <zyan@redhat.com> - 2015-11-09 11:30 +0100

#1265541 — Re: [PATCH] ceph:Fix error handling in the function ceph_readddir_prepopulate

From"Yan, Zheng" <zyan@redhat.com>
Date2015-11-09 11:30 +0100
SubjectRe: [PATCH] ceph:Fix error handling in the function ceph_readddir_prepopulate
Message-ID<qsRS1-598-1@gated-at.bofh.it>
> On Nov 9, 2015, at 05:13, Nicholas Krause <xerofoify@gmail.com> wrote:
> 
> This fixes error handling in the function ceph_readddir_prepopulate
> to properly check if the call to the function ceph_fill_dirfrag has
> failed by returning a error code. Further more if this does arise
> jump to the goto label, out of the function ceph_readdir_prepopulate
> in order to clean up previously allocated resources by this function
> before returning to the caller this errror code in order for all callers
> to be now aware and able to handle this failure in their own intended
> error paths.
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
> fs/ceph/inode.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
> index 96d2bd8..7738be6 100644
> --- a/fs/ceph/inode.c
> +++ b/fs/ceph/inode.c
> @@ -1417,8 +1417,11 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
> 	} else {
> 		dout("readdir_prepopulate %d items under dn %p\n",
> 		     rinfo->dir_nr, parent);
> -		if (rinfo->dir_dir)
> -			ceph_fill_dirfrag(d_inode(parent), rinfo->dir_dir);
> +		if (rinfo->dir_dir) {
> +			err = ceph_fill_dirfrag(d_inode(parent), rinfo->dir_dir);
> +			if (err)
> +				goto out;
> +		}
> 	}
> 

ceph_fill_dirfrag() failure is not fatal. I think it’s better to not skip later code when it happens.

Regards
Yan, Zheng 


> 	if (ceph_frag_is_leftmost(frag) && req->r_readdir_offset == 2) {
> -- 
> 2.5.0
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web