lkml.org 
[lkml]   [2022]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v8 07/11] dm-zoned: ensure only power of 2 zone sizes are allowed
From
On 2022-07-28 14:15, David Sterba wrote:
> On Wed, Jul 27, 2022 at 06:22:41PM +0200, Pankaj Raghav wrote:
>> --- a/drivers/md/dm-zoned-target.c
>> +++ b/drivers/md/dm-zoned-target.c
>> @@ -792,6 +792,10 @@ static int dmz_fixup_devices(struct dm_target *ti)
>> return -EINVAL;
>> }
>> zone_nr_sectors = bdev_zone_sectors(bdev);
>> + if (!is_power_of_2(zone_nr_sectors)) {
>> + ti->error = "Zone size is not power of 2";
>
> This could print what's the value of zone_nr_sectors
Ok. I will rephrase based on Damien's comment and add the
zone_nr_sectors to be included. Thanks.
>
>> + return -EINVAL;
>> + }
>> zoned_dev->zone_nr_sectors = zone_nr_sectors;
>> zoned_dev->nr_zones = bdev_nr_zones(bdev);
>> }
>> @@ -804,6 +808,10 @@ static int dmz_fixup_devices(struct dm_target *ti)
>> return -EINVAL;
>> }
>> zoned_dev->zone_nr_sectors = bdev_zone_sectors(bdev);
>> + if (!is_power_of_2(zoned_dev->zone_nr_sectors)) {
>> + ti->error = "Zone size is not power of 2";
>
> Same
>
>> + return -EINVAL;
>> + }
>> zoned_dev->nr_zones = bdev_nr_zones(bdev);
>> }
>>
>> --
>> 2.25.1

\
 
 \ /
  Last update: 2022-07-29 10:01    [W:0.087 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site