block: fix integrity offset/length conversions#745
block: fix integrity offset/length conversions#745blktests-ci[bot] wants to merge 6 commits intolinus-master_basefrom
Conversation
|
Upstream branch: d60bc14 |
|
Upstream branch: d60bc14 |
7f265e9 to
1a93e79
Compare
|
Upstream branch: d60bc14 |
1a93e79 to
bf9b1b5
Compare
|
Upstream branch: d60bc14 |
bf9b1b5 to
85d88a1
Compare
6b4d829 to
ceec5ed
Compare
|
Upstream branch: b4e0758 |
85d88a1 to
d09e317
Compare
ceec5ed to
3b54e52
Compare
|
Upstream branch: 6596a02 |
d09e317 to
ce676e8
Compare
3b54e52 to
6a0b974
Compare
|
Upstream branch: 507bd4b |
ce676e8 to
d405649
Compare
6a0b974 to
59ca59b
Compare
|
Upstream branch: dd6c438 |
d405649 to
74f7b87
Compare
94f0438 to
857ada9
Compare
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. 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") Signed-off-by: Caleb Sander Mateos <[email protected]> Reviewed-by: Anuj Gupta <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
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. Fixes: 0bde8a1 ("block: add fs_bio_integrity helpers") Signed-off-by: Caleb Sander Mateos <[email protected]> Reviewed-by: Anuj Gupta <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
To allow bio_integrity_intervals() to convert an absolute sector to an absolute integrity interval, use u64 for its argument and return types. Also use SECTOR_SHIFT instead of the magic constant 9. Signed-off-by: Caleb Sander Mateos <[email protected]> Reviewed-by: Anuj Gupta <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
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 <[email protected]> Reviewed-by: Anuj Gupta <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
Use bio_integrity_intervals() to convert blk_rq_pos(rq) to integrity intervals to reduce code duplication. Signed-off-by: Caleb Sander Mateos <[email protected]> Reviewed-by: Anuj Gupta <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
bip_set_seed() and big_get_seed() take/return a sector_t value that's actually an integrity interval number. This is confusing, so pass struct bio instead to bip_set_seed() and convert the bio's device address to integrity intervals. Open-code the access to bip->bip_iter.bi_sector in the one caller of bip_set_seed() that doesn't use the bio device address for the seed. Open-code bip_get_seed() in its one caller. Add a comment to struct bvec_iter's bi_sector field explaining its alternate use for bip_iter. Suggested-by: Christoph Hellwig <[email protected]> Signed-off-by: Caleb Sander Mateos <[email protected]>
|
Upstream branch: dd6c438 |
74f7b87 to
b7ea5f4
Compare
Pull request for series with
subject: block: fix integrity offset/length conversions
version: 2
url: https://patchwork.kernel.org/project/linux-block/list/?series=1081809