Patchwork ext4:Make ext4_split_extent() handle error correctly.

login
register
mail settings
Submitter Yongqiang Yang
Date May 14, 2011, 7:05 a.m.
Message ID <BANLkTintPx6Tugitnodou++sLR1m6SOunA@mail.gmail.com>
Download mbox | patch
Permalink /patch/95545/
State Accepted
Headers show

Comments

Yongqiang Yang - May 14, 2011, 7:05 a.m.
Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
---
 fs/ext4/extents.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Mingming Cao - May 16, 2011, 3:08 p.m.
On Sat, 2011-05-14 at 15:05 +0800, Yongqiang Yang wrote:
> Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>

Reviewed-by: Mingming Cao <cmm@us.ibm.com>
> ---
>  fs/ext4/extents.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index e363f21..b7b667f 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -2716,6 +2716,8 @@ static int ext4_split_extent(handle_t *handle,
>  				       EXT4_EXT_MARK_UNINIT2;
>  		err = ext4_split_extent_at(handle, inode, path,
>  				map->m_lblk + map->m_len, split_flag1, flags1);
> +		if (err)
> +			goto out;
>  	}
> 
>  	ext4_ext_drop_refs(path);


--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Theodore Ts'o - May 23, 2011, 12:51 a.m.
Added to the ext4 tree, thanks.

						- Ted

On Sat, May 14, 2011 at 03:05:05PM +0800, Yongqiang Yang wrote:
> Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
> ---
>  fs/ext4/extents.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index e363f21..b7b667f 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -2716,6 +2716,8 @@ static int ext4_split_extent(handle_t *handle,
>  				       EXT4_EXT_MARK_UNINIT2;
>  		err = ext4_split_extent_at(handle, inode, path,
>  				map->m_lblk + map->m_len, split_flag1, flags1);
> +		if (err)
> +			goto out;
>  	}
> 
>  	ext4_ext_drop_refs(path);
> -- 
> 1.7.5.1
> 
> --
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index e363f21..b7b667f 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2716,6 +2716,8 @@  static int ext4_split_extent(handle_t *handle,
 				       EXT4_EXT_MARK_UNINIT2;
 		err = ext4_split_extent_at(handle, inode, path,
 				map->m_lblk + map->m_len, split_flag1, flags1);
+		if (err)
+			goto out;
 	}

 	ext4_ext_drop_refs(path);