Skip to content

Conversation

@blktests-ci
Copy link

@blktests-ci blktests-ci bot commented Jan 14, 2026

Pull request for series with
subject: block: refactor get_contig_folio_len
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1042135

@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 14, 2026

Upstream branch: b543459
series: https://patchwork.kernel.org/project/linux-block/list/?series=1042135
version: 1

@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 15, 2026

Upstream branch: 944aacb
series: https://patchwork.kernel.org/project/linux-block/list/?series=1042135
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1042135=>linus-master branch from cd6773c to 879f6ad Compare January 15, 2026 09:01
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 8a473ad to fa94b37 Compare January 19, 2026 00:27
@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 19, 2026

Upstream branch: 944aacb
series: https://patchwork.kernel.org/project/linux-block/list/?series=1042135
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1042135=>linus-master branch from 879f6ad to 9a9912f Compare January 19, 2026 00:34
@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 19, 2026

Upstream branch: 944aacb
series: https://patchwork.kernel.org/project/linux-block/list/?series=1043971
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1042135=>linus-master branch from 9a9912f to dffcd4c Compare January 19, 2026 07:52
@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 19, 2026

Upstream branch: 944aacb
series: https://patchwork.kernel.org/project/linux-block/list/?series=1043971
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1042135=>linus-master branch from dffcd4c to 78c9685 Compare January 19, 2026 17:48
@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 19, 2026

Upstream branch: 944aacb
series: https://patchwork.kernel.org/project/linux-block/list/?series=1043971
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1042135=>linus-master branch from 78c9685 to 5f6fd56 Compare January 19, 2026 17:56
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from fa94b37 to 41a5848 Compare January 21, 2026 04:18
@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 21, 2026

Upstream branch: 6c79021
series: https://patchwork.kernel.org/project/linux-block/list/?series=1043971
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1042135=>linus-master branch from 5f6fd56 to 6439c5c Compare January 21, 2026 04:19
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 41a5848 to 30680e5 Compare January 22, 2026 10:04
@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 22, 2026

Upstream branch: a66191c
series: https://patchwork.kernel.org/project/linux-block/list/?series=1043971
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1042135=>linus-master branch from 6439c5c to ad2d493 Compare January 22, 2026 10:04
@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 22, 2026

Upstream branch: a66191c
series: https://patchwork.kernel.org/project/linux-block/list/?series=1043971
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1042135=>linus-master branch from ad2d493 to f6482bf Compare January 22, 2026 11:09
@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 22, 2026

Upstream branch: a66191c
series: https://patchwork.kernel.org/project/linux-block/list/?series=1043971
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1042135=>linus-master branch from f6482bf to 680ed6b Compare January 22, 2026 11:17
Move all of the logic to find the contigous length inside a folio into
get_contig_folio_len instead of keeping some of it in the caller.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Christoph Hellwig added 13 commits January 22, 2026 22:08
bio_add_page fails to add data to the bio when mixing P2P with non-P2P
ranges, or ranges that map to different P2P providers.  In that case
it will trigger that WARN_ON and return an error up the chain instead of
simply starting a new bio as intended.  Fix this by open coding
bio_add_page and handling this case explicitly.  While doing so, stop
merging physical contiguous data that belongs to multiple folios.  While
this merge could lead to more efficient bio packing in some case,
dropping will allow to remove handling of this corner case in other
places and make the code more robust.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Massage __bio_iov_iter_get_pages so that it doesn't need the bio, and
move it to lib/iov_iter.c so that it can be used by block code for
other things than filling a bio and by other subsystems like netfs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Merge bio_release_page into the only remaining caller.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Add helpers to implement bounce buffering of data into a bio to implement
direct I/O for cases where direct user access is not possible because
stable in-flight data is required.  These are intended to be used as
easily as bio_iov_iter_get_pages for the zero-copy path.

The write side is trivial and just copies data into the bounce buffer.
The read side is a lot more complex because it needs to perform the copy
from the completion context, and without preserving the iov_iter through
the call chain.  It steals a trick from the integrity data user interface
and uses the first vector in the bio for the bounce buffer data that is
fed to the block I/O stack, and uses the others to record the user
buffer fragments.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
The "if (dio->error)" in iomap_dio_bio_iter exists to stop submitting
more bios when a completion already return an error.  Commit cfe057f
("iomap_dio_actor(): fix iov_iter bugs") made it revert the iov by
"copied", which is very wrong given that we've already consumed that
range and submitted a bio for it.

Fixes: cfe057f ("iomap_dio_actor(): fix iov_iter bugs")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Use iov_iter_count to check if we need to continue as that just reads
a field in the iov_iter, and only use bio_iov_vecs_to_alloc to calculate
the actual number of vectors to allocate for the bio.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Factor out a separate helper that builds and submits a single bio.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
…_direct

Refactor the two per-bio completion handlers to share common code using
a new helper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
There are good arguments for processing the user completions ASAP vs.
freeing resources ASAP, but freeing the bio first here removes potential
use after free hazards when checking flags, and will simplify the
upcoming bounce buffer support.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Match the more descriptive iov_iter terminology instead of encoding
what we do with them for reads only.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Support using the ioend structure to defer I/O completion for direct
reads in addition to writes.  This requires a check for the operation
to not merge reads and writes in iomap_ioend_can_merge.  This support
will be used for bounce buffered direct I/O reads that need to copy
data back to the user address space on read completion.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Add a new flag that request bounce buffering for direct I/O.  This is
needed to provide the stable pages requirement requested by devices
that need to calculate checksums or parity over the data and allows
file systems to properly work with things like T10 protection
information.  The implementation just calls out to the new bio bounce
buffering helpers to allocate a bounce buffer, which is used for
I/O and to copy to/from it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
…pages

Fix direct I/O on devices that require stable pages by asking iomap
to bounce buffer.  To support this, ioends are used for direct reads
in this case to provide a user context for copying data back from the
bounce buffer.

This fixes qemu when used on devices using T10 protection information
and probably other cases like iSCSI using data digests.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 22, 2026

Upstream branch: a66191c
series: https://patchwork.kernel.org/project/linux-block/list/?series=1043971
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1042135=>linus-master branch from 680ed6b to 455b8d1 Compare January 22, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant