On Thu, August 08, 2013 at 12:24 (+0200), Filipe David Manana wrote:
> On Thu, Aug 8, 2013 at 6:04 AM, Wang Shilong <wangsl.fnst@xxxxxxxxxxxxxx> wrote:
>> find_extent_in_eb() may return ENOMEM, catch this error return value.
>>
>> Signed-off-by: Wang Shilong <wangsl.fnst@xxxxxxxxxxxxxx>
>> Reviewed-by: Miao Xie <miaox@xxxxxxxxxxxxxx>
>> ---
>> 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html