[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ynk7z4FhE2zTrzZh@redhat.com>
Date: Mon, 9 May 2022 12:05:35 -0400
From: Mike Snitzer <snitzer@...hat.com>
To: Pankaj Raghav <p.raghav@...sung.com>
Cc: Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
jaegeuk@...nel.org, hare@...e.de, dsterba@...e.com,
axboe@...nel.dk, hch@....de, snitzer@...nel.org,
Naohiro Aota <naohiro.aota@....com>,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
bvanassche@....org, Luis Chamberlain <mcgrof@...nel.org>,
gost.dev@...sung.com, Josef Bacik <josef@...icpanda.com>,
linux-nvme@...ts.infradead.org, jiangbo.365@...edance.com,
Jens Axboe <axboe@...com>, Chris Mason <clm@...com>,
dm-devel@...hat.com, linux-btrfs@...r.kernel.org,
Alasdair Kergon <agk@...hat.com>, jonathan.derrick@...ux.dev,
linux-fsdevel@...r.kernel.org, Chaitanya Kulkarni <kch@...dia.com>,
Johannes Thumshirn <jth@...nel.org>,
Keith Busch <kbusch@...nel.org>, matias.bjorling@....com,
Sagi Grimberg <sagi@...mberg.me>
Subject: Re: [PATCH v3 11/11] dm-zoned: ensure only power of 2 zone sizes are
allowed
On Mon, May 09 2022 at 7:03P -0400,
Pankaj Raghav <p.raghav@...sung.com> wrote:
> >> ---
> >> drivers/md/dm-zone.c | 12 ++++++++++++
> >> 1 file changed, 12 insertions(+)
> >>
> >> diff --git a/drivers/md/dm-zone.c b/drivers/md/dm-zone.c
> >> index 3e7b1fe15..27dc4ddf2 100644
> >> --- a/drivers/md/dm-zone.c
> >> +++ b/drivers/md/dm-zone.c
> >> @@ -231,6 +231,18 @@ static int dm_revalidate_zones(struct mapped_device *md, struct dm_table *t)
> >> struct request_queue *q = md->queue;
> >> unsigned int noio_flag;
> >> int ret;
> >> + struct block_device *bdev = md->disk->part0;
> >> + sector_t zone_sectors;
> >> + char bname[BDEVNAME_SIZE];
> >> +
> >> + zone_sectors = bdev_zone_sectors(bdev);
> >> +
> >> + if (!is_power_of_2(zone_sectors)) {
> >> + DMWARN("%s: %s only power of two zone size supported\n",
> >> + dm_device_name(md),
> >> + bdevname(bdev, bname));
> >> + return 1;
> >
> > return -EINVAL;
> >
> > The error propagates to dm_table_set_restrictions() so a proper error code must
> > be returned.
> >
> Good point. I will add this in the next rev.
Also, DMWARN already provides the trailing newline, so please remove
the above newline.
Powered by blists - more mailing lists