From: Christoph Hellwig <hch@infradead.org>
To: Damien Le Moal <damien.lemoal@wdc.com>
Cc: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>,
dm-devel@redhat.com, Mike Snitzer <snitzer@redhat.com>
Subject: Re: [PATCH 1/4] block: Enhance blk_revalidate_disk_zones()
Date: Thu, 24 Oct 2019 00:08:38 -0700 [thread overview]
Message-ID: <20191024070838.GA19572@infradead.org> (raw)
In-Reply-To: <20191024065006.8684-2-damien.lemoal@wdc.com>
> diff --git a/block/blk-zoned.c b/block/blk-zoned.c
> index 4bc5f260248a..293891b7068a 100644
> --- a/block/blk-zoned.c
> +++ b/block/blk-zoned.c
> @@ -441,6 +441,57 @@ void blk_queue_free_zone_bitmaps(struct request_queue *q)
> q->seq_zones_wlock = NULL;
> }
>
> +/**
> + * blk_check_zone - Check a zone information
> + * @q: request queue
> + * @zone: the zone to check
> + * @sector: start sector of the zone
> + *
> + * Helper function to check zones of a zoned block device. Returns true if the
> + * zone is correct and false if a problem is detected.
> + */
> +static bool blk_check_zone(struct gendisk *disk, struct blk_zone *zone,
> + sector_t *sector)
Maybe call this blk_zone_valid? Also in many places we don't really
do the verbose kerneldoc comments with the duplicated parameter names
for local functions, as the scripts only pick up non-stack ones anyway.
> + /*
> + * All zones must have the same size, with the exception on an eventual
> + * smaller last zone.
> + */
> + if (zone->start + zone_sectors < capacity &&
> + zone->len != zone_sectors) {
> + pr_warn("%s: Invalid zone device with non constant zone size\n",
> + disk->disk_name);
> + return false;
> + }
I think we should also move the power of two zone size check here
instead of leaving it in the driver.
next prev parent reply other threads:[~2019-10-24 7:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 6:50 [PATCH 0/4] zoned block device report zones enhancements Damien Le Moal
2019-10-24 6:50 ` [PATCH 1/4] block: Enhance blk_revalidate_disk_zones() Damien Le Moal
2019-10-24 7:08 ` Christoph Hellwig [this message]
2019-10-25 5:15 ` Damien Le Moal
2019-10-24 7:20 ` Keith Busch
2019-10-24 6:50 ` [PATCH 2/4] block: Simplify report zones execution Damien Le Moal
2019-10-24 7:10 ` Christoph Hellwig
2019-10-25 5:17 ` Javier González
2019-10-24 6:50 ` [PATCH 3/4] block: Introduce report zones queue limits Damien Le Moal
2019-10-24 6:50 ` [PATCH 4/4] block: Generically handle report zones buffer Damien Le Moal
2019-10-24 7:13 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191024070838.GA19572@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=damien.lemoal@wdc.com \
--cc=dm-devel@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=snitzer@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).