Re: [PATCH 2/2] block: fix aligning of bounced dio read bios
Shin'ichiro Kawasaki <[email protected]> Wed, 29 Jul 2026 21:26:14 +0900
| Newsgroups | org.kernel.vger.linux-block |
|---|---|
| Message-ID | <amnwHyJFp0XCXHEp@shinmob> |
On Jul 16, 2026 / 11:12, Christoph Hellwig wrote:
> bio_iov_iter_align_down expects the "normal" biovec layout from vector 0,
> while bio_iov_iter_bounce_read abuses vector 0 for a bounce buffer
> allocation. Pass an explicit bvec to bio_iov_iter_align_down to deal
> with this case to avoid a double unpin.
>
> Additionally we need to free the folio if no bio_vec could be added,
> and adjust the size of the first bio_vec that contains the bounce buffer
> when the I/O size is aligned down.
>
> Fixes: e7b8b3c5b2a6 ("block: align down bounces bios")
> Reported-by: 0wnerD1ed <[email protected]>
> Signed-off-by: Christoph Hellwig <[email protected]>
> Tested-by: 0wnerD1ed <[email protected]>
> Reviewed-by: Keith Busch <[email protected]>
FYI, 0wnerDied created a GitHub Pull Request to add new blktests test cases as
the regression tests of this fix patch [*]. Now review is ongoing for the test
cases. If any one is interested in, feel free to chime in the review.
[*] https://github.com/linux-blktests/blktests/pull/251