Re: [PATCH 2/3] Btrfs: catch error return value from find_extent_in_eb()

2013-08-08 Thread Wang Shilong
On 08/08/2013 06:24 PM, Filipe David Manana wrote:
> On Thu, Aug 8, 2013 at 6:04 AM, Wang Shilong  
> wrote:
>> find_extent_in_eb() may return ENOMEM, catch this error return value.
>>
>> Signed-off-by: Wang Shilong 
>> Reviewed-by: Miao Xie 
>> ---
>>  fs/btrfs/backref.c | 4 
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
>> index 54e7610..f7781e6 100644
>> --- a/fs/btrfs/backref.c
>> +++ b/fs/btrfs/backref.c
>> @@ -934,6 +934,10 @@ again:
>> }
>> ret = find_extent_in_eb(eb, bytenr,
>> *extent_item_pos, 
>> &eie);
>> +   if (ret) {
>> +   free_extent_buffer(eb);
>> +   goto out;
>> +   }
>> ref->inode_list = eie;
>> free_extent_buffer(eb);
>> }
> 
> Hello, this is a duplicate of:  https://patchwork.kernel.org/patch/2835989/

Yeah, just ignore my patch.

Thanks,
Wang
> 
> thanks
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Btrfs: catch error return value from find_extent_in_eb()

2013-08-08 Thread Jan Schmidt
 
On Thu, August 08, 2013 at 12:24 (+0200), Filipe David Manana wrote:
> On Thu, Aug 8, 2013 at 6:04 AM, Wang Shilong  
> wrote:
>> find_extent_in_eb() may return ENOMEM, catch this error return value.
>>
>> Signed-off-by: Wang Shilong 
>> Reviewed-by: Miao Xie 
>> ---
>>  fs/btrfs/backref.c | 4 
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
>> index 54e7610..f7781e6 100644
>> --- a/fs/btrfs/backref.c
>> +++ b/fs/btrfs/backref.c
>> @@ -934,6 +934,10 @@ again:
>> }
>> ret = find_extent_in_eb(eb, bytenr,
>> *extent_item_pos, 
>> &eie);
>> +   if (ret) {
>> +   free_extent_buffer(eb);
>> +   goto out;
>> +   }
>> ref->inode_list = eie;
>> free_extent_buffer(eb);
>> }
> 
> Hello, this is a duplicate of:  https://patchwork.kernel.org/patch/2835989/

Your linked patch checks for ret < 0, which is a safer option since there are
functions down the stack returning > 0 or 0 for success and < 0 for errors.
Currently, find_extent_in_eb doesn't return their return values, but I'd rather
be a bit more on the safe side and use your patch.

Thanks,
-Jan
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Btrfs: catch error return value from find_extent_in_eb()

2013-08-08 Thread Filipe David Manana
On Thu, Aug 8, 2013 at 6:04 AM, Wang Shilong  wrote:
> find_extent_in_eb() may return ENOMEM, catch this error return value.
>
> Signed-off-by: Wang Shilong 
> Reviewed-by: Miao Xie 
> ---
>  fs/btrfs/backref.c | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
> index 54e7610..f7781e6 100644
> --- a/fs/btrfs/backref.c
> +++ b/fs/btrfs/backref.c
> @@ -934,6 +934,10 @@ again:
> }
> ret = find_extent_in_eb(eb, bytenr,
> *extent_item_pos, 
> &eie);
> +   if (ret) {
> +   free_extent_buffer(eb);
> +   goto out;
> +   }
> ref->inode_list = eie;
> free_extent_buffer(eb);
> }

Hello, this is a duplicate of:  https://patchwork.kernel.org/patch/2835989/

thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] Btrfs: catch error return value from find_extent_in_eb()

2013-08-07 Thread Wang Shilong
find_extent_in_eb() may return ENOMEM, catch this error return value.

Signed-off-by: Wang Shilong 
Reviewed-by: Miao Xie 
---
 fs/btrfs/backref.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 54e7610..f7781e6 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -934,6 +934,10 @@ again:
}
ret = find_extent_in_eb(eb, bytenr,
*extent_item_pos, &eie);
+   if (ret) {
+   free_extent_buffer(eb);
+   goto out;
+   }
ref->inode_list = eie;
free_extent_buffer(eb);
}
-- 
1.8.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html