From: Christoph Hellwig <hch@lst.de>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org,
Damien Le Moal <Damien.LeMoal@wdc.com>,
Naohiro Aota <naohiro.aota@wdc.com>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] block: support zone append bvecs
Date: Tue, 23 Mar 2021 13:30:02 +0100 [thread overview]
Message-ID: <20210323123002.GA30758@lst.de> (raw)
In-Reply-To: <739a96e185f008c238fcf06cb22068016149ad4a.1616497531.git.johannes.thumshirn@wdc.com>
On Tue, Mar 23, 2021 at 08:06:56PM +0900, Johannes Thumshirn wrote:
> diff --git a/block/bio.c b/block/bio.c
> index 26b7f721cda8..215fe24a01ee 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -1094,8 +1094,14 @@ int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter)
> int ret = 0;
>
> if (iov_iter_is_bvec(iter)) {
> - if (WARN_ON_ONCE(bio_op(bio) == REQ_OP_ZONE_APPEND))
> - return -EINVAL;
> + if (bio_op(bio) == REQ_OP_ZONE_APPEND) {
> + struct request_queue *q = bio->bi_bdev->bd_disk->queue;
> + unsigned int max_append =
> + queue_max_zone_append_sectors(q) << 9;
> +
> + if (WARN_ON_ONCE(iter->count > max_append))
> + return -EINVAL;
> + }
That is not correct. bio_iov_iter_get_pages just fills the bio as far
as we can, and then returns 0 for the next call to continue. Basically
what you want here is a partial version of bio_iov_bvec_set.
next prev parent reply other threads:[~2021-03-23 12:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-23 11:06 [PATCH] block: support zone append bvecs Johannes Thumshirn
2021-03-23 12:30 ` Christoph Hellwig [this message]
2021-03-24 7:07 ` Johannes Thumshirn
2021-03-24 7:11 ` Christoph Hellwig
2021-03-24 7:12 ` Johannes Thumshirn
2021-03-24 10:09 ` Johannes Thumshirn
2021-03-24 10:22 ` Damien Le Moal
2021-03-24 11:05 ` Christoph Hellwig
2021-03-24 12:12 ` Johannes Thumshirn
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=20210323123002.GA30758@lst.de \
--to=hch@lst.de \
--cc=Damien.LeMoal@wdc.com \
--cc=axboe@kernel.dk \
--cc=johannes.thumshirn@wdc.com \
--cc=linux-block@vger.kernel.org \
--cc=naohiro.aota@wdc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.