Skip to content

Commit b13e0c7

Browse files
martinkpetersenaxboe
authored andcommitted
block: bio-integrity: Advance seed correctly for larger interval sizes
Commit 309a62f ("bio-integrity: bio_integrity_advance must update integrity seed") added code to update the integrity seed value when advancing a bio. However, it failed to take into account that the integrity interval might be larger than the 512-byte block layer sector size. This broke bio splitting on PI devices with 4KB logical blocks. The seed value should be advanced by bio_integrity_intervals() and not the number of sectors. Cc: Dmitry Monakhov <[email protected]> Cc: [email protected] Fixes: 309a62f ("bio-integrity: bio_integrity_advance must update integrity seed") Tested-by: Dmitry Ivanov <[email protected]> Reported-by: Alexey Lyashkov <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent e8db8c9 commit b13e0c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/bio-integrity.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ void bio_integrity_advance(struct bio *bio, unsigned int bytes_done)
373373
struct blk_integrity *bi = blk_get_integrity(bio->bi_bdev->bd_disk);
374374
unsigned bytes = bio_integrity_bytes(bi, bytes_done >> 9);
375375

376-
bip->bip_iter.bi_sector += bytes_done >> 9;
376+
bip->bip_iter.bi_sector += bio_integrity_intervals(bi, bytes_done >> 9);
377377
bvec_iter_advance(bip->bip_vec, &bip->bip_iter, bytes);
378378
}
379379

0 commit comments

Comments
 (0)