Skip to content

Conversation

@blktests-ci
Copy link

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

Pull request for series with
subject: block: factor out a bio_integrity_action helper
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1048172

@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 29, 2026

Upstream branch: 4ded82c
series: https://patchwork.kernel.org/project/linux-block/list/?series=1048172
version: 1

@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 29, 2026

Upstream branch: 1171e38
series: https://patchwork.kernel.org/project/linux-block/list/?series=1048172
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1044985=>for-next branch from 68ca456 to 23bed37 Compare January 29, 2026 09:16
@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 29, 2026

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

@blktests-ci blktests-ci bot force-pushed the series/1044985=>for-next branch from 23bed37 to 536053d Compare January 29, 2026 20:24
Christoph Hellwig added 15 commits January 31, 2026 01:13
Split the logic to see if a bio needs integrity metadata from
bio_integrity_prep into a reusable helper than can be called from
file system code.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Anuj Gupta <[email protected]>
Reviewed-by: Kanchan Joshi <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Add a helper to set the seed and check flag based on useful defaults
from the profile.

Note that this includes a small behavior change, as we now only set the
seed if any action is set, which is fine as nothing will look at it
otherwise.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Anuj Gupta <[email protected]>
Reviewed-by: Kanchan Joshi <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
Factor out a helper to see if the block device has an integrity checksum
from bdev_stable_writes so that it can be reused for other checks.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Anuj Gupta <[email protected]>
Reviewed-by: Kanchan Joshi <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
Return the status from verify instead of directly stashing it in the bio,
and rename the helpers to use the usual bio_ prefix for things operating
on a bio.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Anuj Gupta <[email protected]>
Reviewed-by: Kanchan Joshi <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
File systems that generate integrity will need this, so move it out
of the block private or blk-mq specific headers.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Anuj Gupta <[email protected]>
Reviewed-by: Kanchan Joshi <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
Add a set of helpers for file system initiated integrity information.
These include mempool backed allocations and verifying based on a passed
in sector and size which is often available from file system completion
routines.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Anuj Gupta <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
Reviewed-by: Kanchan Joshi <[email protected]>
Allow the file system to limit the size processed in a single
bounce operation.  This is needed when generating integrity data
so that the size of a single integrity segment can't overflow.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Anuj Gupta <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
Split out the logic to allocate a new bio and only keep the fast path
that adds more data to an existing bio in iomap_bio_read_folio_range.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
This provides additional context for file systems.

Rename the fuse instance to match the method name while we're at it.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
Move the NULL check into the callers to simplify the callees.

Fuse was missing this before, but has a constant read_ctx that is
never NULL or changed, so no change here either.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
File systems such as btrfs have additional operations with bios such as
verifying data checksums.  Allow file systems to hook into submission
of the bio to allow for this processing by replacing the direct
submit_bio call in iomap_read_alloc_bio with a call into ->submit_read
and exporting iomap_read_alloc_bio.  Also add a new field to
struct iomap_read_folio_ctx to track the file logic offset of the current
read context.

Based on a patch from Goldwyn Rodrigues <[email protected]>.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
Optionally allocate the bio from the bioset provided in
iomap_read_folio_ops.  If no bioset is provided, fs_bio_set is still
used, which is the standard bioset for file systems.

Based on a patch from Goldwyn Rodrigues <[email protected]>.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
Support using the ioend structure to defer I/O completion for
buffered reads by calling into the buffered read I/O completion
handler from iomap_finish_ioend.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
Add support for generating / verifying protection information in iomap.
This is done by hooking into the bio submission and then using the
generic PI helpers.  Compared to just using the block layer auto PI
this extends the protection envelope and also prepares for eventually
passing through PI from userspace at least for direct I/O.

To generate or verify PI, the file system needs to set the
IOMAP_F_INTEGRITY flag on the iomap for the request, and ensure the
ioends are used for all integrity I/O.  Additionally the file system
must defer read I/O completions to user context so that the guard
tag validation isn't run from interrupt context.

Signed-off-by: Christoph Hellwig <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Add support for generating / verifying protection information in the file
system.  This is largely done by simply setting the IOMAP_F_INTEGRITY
flag and letting iomap do all of the work.  XFS just has to ensure that
the data read completions for integrity data are run from user context.

For zoned writeback, XFS also has to generate the integrity data itself
as the zoned writeback path is not using the generic writeback_submit
implementation.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Tested-by: Anuj Gupta <[email protected]>
@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 30, 2026

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

@blktests-ci blktests-ci bot force-pushed the series/1044985=>for-next branch from 536053d to 6c4470a Compare January 30, 2026 16:14
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.

0 participants