All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH V2] ocfs2: return error while ocfs2_figure_merge_contig_type failing
@ 2015-04-22  0:36 Xue jiufei
  2015-04-22  5:19 ` Junxiao Bi
  2015-04-22 21:45 ` Andrew Morton
  0 siblings, 2 replies; 6+ messages in thread
From: Xue jiufei @ 2015-04-22  0:36 UTC (permalink / raw)
  To: ocfs2-devel

Now function ocfs2_figure_merge_contig_type() still return CONTIG_NONE
when some error occurs which will cause unpredictable error.
So return error while ocfs2_figure_merge_contig_type failing.

Signed-off-by: joyce.xue <xuejiufei@huawei.com>
---
 fs/ocfs2/alloc.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 044158b..2d07b38 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -4313,11 +4313,11 @@ out:
 	return ret;
 }
 
-static enum ocfs2_contig_type
-ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
+static int ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
 			       struct ocfs2_path *path,
 			       struct ocfs2_extent_list *el, int index,
-			       struct ocfs2_extent_rec *split_rec)
+			       struct ocfs2_extent_rec *split_rec,
+			       struct ocfs2_merge_ctxt *ctxt)
 {
 	int status;
 	enum ocfs2_contig_type ret = CONTIG_NONE;
@@ -4431,12 +4431,15 @@ ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
 	}
 
 out:
+	if (status == 0)
+		ctxt->c_contig_type = ret;
+
 	if (left_path)
 		ocfs2_free_path(left_path);
 	if (right_path)
 		ocfs2_free_path(right_path);
 
-	return ret;
+	return status;
 }
 
 static void ocfs2_figure_contig_type(struct ocfs2_extent_tree *et,
@@ -5042,9 +5045,14 @@ int ocfs2_split_extent(handle_t *handle,
 		goto out;
 	}
 
-	ctxt.c_contig_type = ocfs2_figure_merge_contig_type(et, path, el,
-							    split_index,
-							    split_rec);
+	ret =  ocfs2_figure_merge_contig_type(et, path, el,
+					      split_index,
+					      split_rec,
+					      &ctxt);
+	if (ret) {
+		mlog_errno(ret);
+		goto out;
+	}
 
 	/*
 	 * The core merge / split code wants to know how much room is
-- 
1.8.4.3

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

* [Ocfs2-devel] [PATCH V2] ocfs2: return error while ocfs2_figure_merge_contig_type failing
  2015-04-22  0:36 [Ocfs2-devel] [PATCH V2] ocfs2: return error while ocfs2_figure_merge_contig_type failing Xue jiufei
@ 2015-04-22  5:19 ` Junxiao Bi
  2015-04-22  5:42   ` Joseph Qi
  2015-04-22 21:45 ` Andrew Morton
  1 sibling, 1 reply; 6+ messages in thread
From: Junxiao Bi @ 2015-04-22  5:19 UTC (permalink / raw)
  To: ocfs2-devel

On 04/22/2015 08:36 AM, Xue jiufei wrote:
> Now function ocfs2_figure_merge_contig_type() still return CONTIG_NONE
> when some error occurs which will cause unpredictable error.
> So return error while ocfs2_figure_merge_contig_type failing.
> 
> Signed-off-by: joyce.xue <xuejiufei@huawei.com>
Looks fine.

Reviewed-by: Junxiao Bi <junxiao.bi@oracle.com>
> ---
>  fs/ocfs2/alloc.c | 22 +++++++++++++++-------
>  1 file changed, 15 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
> index 044158b..2d07b38 100644
> --- a/fs/ocfs2/alloc.c
> +++ b/fs/ocfs2/alloc.c
> @@ -4313,11 +4313,11 @@ out:
>  	return ret;
>  }
>  
> -static enum ocfs2_contig_type
> -ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
> +static int ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
>  			       struct ocfs2_path *path,
>  			       struct ocfs2_extent_list *el, int index,
> -			       struct ocfs2_extent_rec *split_rec)
> +			       struct ocfs2_extent_rec *split_rec,
> +			       struct ocfs2_merge_ctxt *ctxt)
>  {
>  	int status;
>  	enum ocfs2_contig_type ret = CONTIG_NONE;
> @@ -4431,12 +4431,15 @@ ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
>  	}
>  
>  out:
> +	if (status == 0)
> +		ctxt->c_contig_type = ret;
> +
>  	if (left_path)
>  		ocfs2_free_path(left_path);
>  	if (right_path)
>  		ocfs2_free_path(right_path);
>  
> -	return ret;
> +	return status;
>  }
>  
>  static void ocfs2_figure_contig_type(struct ocfs2_extent_tree *et,
> @@ -5042,9 +5045,14 @@ int ocfs2_split_extent(handle_t *handle,
>  		goto out;
>  	}
>  
> -	ctxt.c_contig_type = ocfs2_figure_merge_contig_type(et, path, el,
> -							    split_index,
> -							    split_rec);
> +	ret =  ocfs2_figure_merge_contig_type(et, path, el,
> +					      split_index,
> +					      split_rec,
> +					      &ctxt);
> +	if (ret) {
> +		mlog_errno(ret);
> +		goto out;
> +	}
>  
>  	/*
>  	 * The core merge / split code wants to know how much room is
> 

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

* [Ocfs2-devel] [PATCH V2] ocfs2: return error while ocfs2_figure_merge_contig_type failing
  2015-04-22  5:19 ` Junxiao Bi
@ 2015-04-22  5:42   ` Joseph Qi
  0 siblings, 0 replies; 6+ messages in thread
From: Joseph Qi @ 2015-04-22  5:42 UTC (permalink / raw)
  To: ocfs2-devel

On 2015/4/22 13:19, Junxiao Bi wrote:
> On 04/22/2015 08:36 AM, Xue jiufei wrote:
>> > Now function ocfs2_figure_merge_contig_type() still return CONTIG_NONE
>> > when some error occurs which will cause unpredictable error.
>> > So return error while ocfs2_figure_merge_contig_type failing.
>> > 
>> > Signed-off-by: joyce.xue <xuejiufei@huawei.com>
> Looks fine.
> 
> Reviewed-by: Junxiao Bi <junxiao.bi@oracle.com>

Reviewed-by: Joseph Qi <joseph.qi@huawei.com>

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

* [Ocfs2-devel] [PATCH V2] ocfs2: return error while ocfs2_figure_merge_contig_type failing
  2015-04-22  0:36 [Ocfs2-devel] [PATCH V2] ocfs2: return error while ocfs2_figure_merge_contig_type failing Xue jiufei
  2015-04-22  5:19 ` Junxiao Bi
@ 2015-04-22 21:45 ` Andrew Morton
  2015-04-25  2:15   ` Xue jiufei
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2015-04-22 21:45 UTC (permalink / raw)
  To: ocfs2-devel

On Wed, 22 Apr 2015 08:36:10 +0800 Xue jiufei <xuejiufei@huawei.com> wrote:

> Now function ocfs2_figure_merge_contig_type() still return CONTIG_NONE
> when some error occurs which will cause unpredictable error.
> So return error while ocfs2_figure_merge_contig_type failing.

Can you please redo this patch against current mainline?  The
conflicts are significant.

Thanks.

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

* [Ocfs2-devel] [PATCH V2] ocfs2: return error while ocfs2_figure_merge_contig_type failing
  2015-04-22 21:45 ` Andrew Morton
@ 2015-04-25  2:15   ` Xue jiufei
  2015-04-25  2:56     ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Xue jiufei @ 2015-04-25  2:15 UTC (permalink / raw)
  To: ocfs2-devel

Hi andrew,
I did this against mainline linux-4.0. Do you mean that I should
do patch against linux-next tree?

Thanks.

On 2015/4/23 5:45, Andrew Morton wrote:
> On Wed, 22 Apr 2015 08:36:10 +0800 Xue jiufei <xuejiufei@huawei.com> wrote:
> 
>> Now function ocfs2_figure_merge_contig_type() still return CONTIG_NONE
>> when some error occurs which will cause unpredictable error.
>> So return error while ocfs2_figure_merge_contig_type failing.
> 
> Can you please redo this patch against current mainline?  The
> conflicts are significant.
> 
> Thanks.
> 
> 

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

* [Ocfs2-devel] [PATCH V2] ocfs2: return error while ocfs2_figure_merge_contig_type failing
  2015-04-25  2:15   ` Xue jiufei
@ 2015-04-25  2:56     ` Andrew Morton
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Morton @ 2015-04-25  2:56 UTC (permalink / raw)
  To: ocfs2-devel

On Sat, 25 Apr 2015 10:15:31 +0800
Xue jiufei <xuejiufei@huawei.com> wrote:

> Hi andrew,
> I did this against mainline linux-4.0.

That's extremely out of date ;)

> Do you mean that I should
> do patch against linux-next tree?

"current mainline" is current Linus git.  Or wait for 4.1-rc1.

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

end of thread, other threads:[~2015-04-25  2:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-22  0:36 [Ocfs2-devel] [PATCH V2] ocfs2: return error while ocfs2_figure_merge_contig_type failing Xue jiufei
2015-04-22  5:19 ` Junxiao Bi
2015-04-22  5:42   ` Joseph Qi
2015-04-22 21:45 ` Andrew Morton
2015-04-25  2:15   ` Xue jiufei
2015-04-25  2:56     ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.