From: Christoph Hellwig <hch@lst.de>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Ed Tsai <ed.tsai@mediatek.com>
Subject: Re: [PATCH V2 1/2] block: don't call into iov_iter_revert if nothing is left
Date: Thu, 9 Nov 2023 15:35:17 +0100 [thread overview]
Message-ID: <20231109143517.GA30592@lst.de> (raw)
In-Reply-To: <20231109082827.2276696-2-ming.lei@redhat.com>
> if (bio->bi_bdev) {
> size_t trim = size & (bdev_logical_block_size(bio->bi_bdev) - 1);
> - iov_iter_revert(iter, trim);
> - size -= trim;
> +
> + if (trim) {
> + iov_iter_revert(iter, trim);
> + size -= trim;
> + }
We also need to fix this. This isn't supposed to be called without
a bdev set, but Kent broke this. But if we don't have a bdev
we need to pass the block size manually and still do the revert if needed.
next prev parent reply other threads:[~2023-11-09 14:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 8:28 [PATCH V2 0/2] block: try to make aligned bio in case of big chunk IO Ming Lei
2023-11-09 8:28 ` [PATCH V2 1/2] block: don't call into iov_iter_revert if nothing is left Ming Lei
2023-11-09 14:35 ` Christoph Hellwig [this message]
2023-11-09 8:28 ` [PATCH V2 2/2] block: try to make aligned bio in case of big chunk IO Ming Lei
2023-11-09 14:39 ` Christoph Hellwig
2023-11-09 19:30 ` kernel test robot
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=20231109143517.GA30592@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=ed.tsai@mediatek.com \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@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