Skip to content

block: fix integrity offset/length conversions#722

Closed
blktests-ci[bot] wants to merge 6 commits intofor-next_basefrom
series/1077122=>for-next
Closed

block: fix integrity offset/length conversions#722
blktests-ci[bot] wants to merge 6 commits intofor-next_basefrom
series/1077122=>for-next

Conversation

@blktests-ci
Copy link
Copy Markdown

@blktests-ci blktests-ci bot commented Apr 3, 2026

Pull request for series with
subject: block: fix integrity offset/length conversions
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1077122

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 3, 2026

Upstream branch: 5d77540
series: https://patchwork.kernel.org/project/linux-block/list/?series=1077122
version: 1

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 4, 2026

Upstream branch: 6030f93
series: https://patchwork.kernel.org/project/linux-block/list/?series=1077122
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1077122=>for-next branch from b0ef450 to a3b28c4 Compare April 4, 2026 05:35
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 4, 2026

Upstream branch: 15c4162
series: https://patchwork.kernel.org/project/linux-block/list/?series=1077122
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1077122=>for-next branch from a3b28c4 to 88fa415 Compare April 4, 2026 16:55
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 5, 2026

Upstream branch: 15c4162
series: https://patchwork.kernel.org/project/linux-block/list/?series=1077122
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1077122=>for-next branch from 88fa415 to 797365c Compare April 5, 2026 11:35
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 5, 2026

Upstream branch: 15c4162
series: https://patchwork.kernel.org/project/linux-block/list/?series=1077122
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1077122=>for-next branch from 797365c to 7604e46 Compare April 5, 2026 23:53
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 6, 2026

Upstream branch: 15c4162
series: https://patchwork.kernel.org/project/linux-block/list/?series=1077122
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1077122=>for-next branch from 7604e46 to db6e20c Compare April 6, 2026 06:40
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 8, 2026

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

@blktests-ci blktests-ci bot force-pushed the series/1077122=>for-next branch from db6e20c to 088a3c9 Compare April 8, 2026 10:30
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 10, 2026

Upstream branch: 7eb7e8a
series: https://patchwork.kernel.org/project/linux-block/list/?series=1077122
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1077122=>for-next branch from 088a3c9 to a2b90af Compare April 10, 2026 00:52
To allow bio_integrity_intervals() to convert an absolute sector_t to an
absolute integrity interval, change its argument type to sector_t and
its return type to u64.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
bio_integrity_setup_default() and blk_integrity_iterate() set the
integrity seed (initial reference tag) to the absolute address in the
block device in units of 512-byte sectors. The seed is correctly
incremented/decremented in units of integrity intervals in
bio_integrity_map_iter(), bio_integrity_advance(), and
blk_integrity_interval(). As a result, the ref tag written or read to a
particular integrity interval on a block device with integrity interval
size > 512 bytes varies with the starting offset of the read/write.

Convert the initial seed to units of integrity intervals so a consistent
ref tag is used for each integrity interval.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Fixes: 3be91c4 ("block: Deprecate the use of the term sector in the context of block integrity")
Fixes: 63573e3 ("bio-integrity: Restore original iterator on verify stage")
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
bio_integrity_verify() expects the passed struct bvec_iter to be an
iterator over bio data, not integrity. So construct a separate data
bvec_iter without the bio_integrity_bytes() conversion and pass it to
bio_integrity_verify() instead of bip_iter.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Fixes: 0bde8a1 ("block: add fs_bio_integrity helpers")
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
bip_iter.bi_sector is meant to be in units of integrity intervals rather
than 512-byte sectors. bio_integrity_verify() doesn't actually use it
currently (it uses the passed in struct bvec_iter's bi_sector instead).
But let's set it to the expected value for consistency.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Use bio_integrity_intervals() to convert blk_rq_pos(rq) to integrity
intervals to reduce code duplication.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Use bio_integrity_intervals() to convert bio->bi_iter.bi_sector to
integrity intervals to reduce code duplication. Make the same change in
the nvmet code that appears to have been copied from the target code.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci bot commented Apr 13, 2026

Upstream branch: 88a57e1
series: https://patchwork.kernel.org/project/linux-block/list/?series=1077122
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1077122=>for-next branch from a2b90af to 3d826e8 Compare April 13, 2026 06:24
@blktests-ci blktests-ci bot closed this Apr 16, 2026
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