[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <878qhld1xq.fsf@>
Date: Wed, 08 Oct 2025 14:15:45 +0200
From: Miquel Sabaté Solà <mssola@...ola.com>
To: Johannes Thumshirn <Johannes.Thumshirn@....com>
Cc: "linux-btrfs@...r.kernel.org" <linux-btrfs@...r.kernel.org>,
"clm@...com" <clm@...com>, "dsterba@...e.com" <dsterba@...e.com>,
Naohiro Aota <Naohiro.Aota@....com>, "boris@....io" <boris@....io>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] btrfs: fix memory leaks when rejecting a non SINGLE
data profile without an RST
Johannes Thumshirn @ 2025-10-08 12:04 GMT:
> On 10/8/25 9:41 AM, Miquel Sabaté Solà wrote:
>> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
>> index e3341a84f4ab..8f767a6cd49b 100644
>> --- a/fs/btrfs/zoned.c
>> +++ b/fs/btrfs/zoned.c
>> @@ -1753,7 +1753,11 @@ int btrfs_load_block_group_zone_info(struct btrfs_block_group *cache, bool new)
>> !fs_info->stripe_root) {
>> btrfs_err(fs_info, "zoned: data %s needs raid-stripe-tree",
>> btrfs_bg_type_to_raid_name(map->type));
>> - return -EINVAL;
>> + /*
>> + * Note that this might be overwritten by later if statements,
>> + * but the error will be at least printed by the line above.
>> + */
>
>
> Not convinced the comment is useful.
>
>> + ret = -EINVAL;
>> }
>>
>> if (unlikely(cache->alloc_offset > cache->zone_capacity)) {
>> @@ -1785,6 +1789,7 @@ int btrfs_load_block_group_zone_info(struct btrfs_block_group *cache, bool new)
>> btrfs_free_chunk_map(cache->physical_map);
>> cache->physical_map = NULL;
>> }
>> +
>> bitmap_free(active);
>> kfree(zone_info);
>>
>
>
> Stray newline.
>
> Other than that,
>
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@....com>
Thanks for the review! Let me send a v3 shortly with your comments
applied.
Download attachment "signature.asc" of type "application/pgp-signature" (898 bytes)
Powered by blists - more mailing lists