bio-integrity-fs: pass data iter to bio_integrity_verify()
PATCH v4 1/1 bio-integrity-fs: pass data iter to bio_integrity_verify()
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.
---
v4: split from series changing ref tag seed units
v3: https://lore.kernel.org/linux-block/[email protected]/
block/bio-integrity-fs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
block/bio-integrity-fs.c +5 -1
@@ -53,21 +53,25 @@ EXPORT_SYMBOL_GPL(fs_bio_integrity_generate);int fs_bio_integrity_verify (struct bio *bio,sector_t sector,unsigned int size) {struct blk_integrity *bi =blk_get_integrity (bio->bi_bdev->bd_disk);struct bio_integrity_payload *bip =bio_integrity (bio); +struct bvec_iter data_iter = { + .bi_sector = sector, + .bi_size = size, + };/* * Reinitialize bip->bip_iter. * * This is for use in the submitter after the driver is done with the * bio. Requires the submitter to remember the sector and the size. */ memset (&bip->bip_iter,0 ,sizeof (bip->bip_iter)); bip->bip_iter.bi_sector = sector; bip->bip_iter.bi_size =bio_integrity_bytes (bi, size >>SECTOR_SHIFT ); -return blk_status_to_errno (bio_integrity_verify (bio, &bip->bip_iter)); +return blk_status_to_errno (bio_integrity_verify (bio, &data_iter)); }static int __init fs_bio_integrity_init (void ) { fs_bio_integrity_cache = kmem_cache_create("fs_bio_integrity",
Signature · 1 line
2.54.0
Hi Jens,
Gentle ping on this fix for 7.1.
Thanks,
Caleb
Quoted 51 lines · Caleb Sander Mateos
bio_integrity_verify()expects the passed structbvec_iterto be an iterator over bio data, not integrity. So construct a separate databvec_iterwithout thebio_integrity_bytes()conversion and pass it tobio_integrity_verify()instead ofbip_iter.Fixes 0bde8a12b554 ("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]>---
v4: split from series changing ref tag seed units
v3: https://lore.kernel.org/linux-block/[email protected]/block/bio-integrity-fs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)block/bio-integrity-fs.c +5
-2@@ -53,21 +53,25 @@ EXPORT_SYMBOL_GPL(fs_bio_integrity_generate);int fs_bio_integrity_verify (struct bio *bio,sector_t sector,unsigned int size) {struct blk_integrity *bi =blk_get_integrity (bio->bi_bdev->bd_disk);struct bio_integrity_payload *bip =bio_integrity (bio); +struct bvec_iter data_iter = { + .bi_sector = sector, + .bi_size = size, + };/* * Reinitialize bip->bip_iter. * * This is for use in the submitter after the driver is done with the * bio. Requires the submitter to remember the sector and the size. */ memset (&bip->bip_iter,0 ,sizeof (bip->bip_iter)); bip->bip_iter.bi_sector = sector; bip->bip_iter.bi_size =bio_integrity_bytes (bi, size >>SECTOR_SHIFT ); -return blk_status_to_errno (bio_integrity_verify (bio, &bip->bip_iter)); +return blk_status_to_errno (bio_integrity_verify (bio, &data_iter)); }static int __init fs_bio_integrity_init (void ) { fs_bio_integrity_cache = kmem_cache_create("fs_bio_integrity", --2.54.0
Quoted 4 lines · Caleb Sander Mateos
bio_integrity_verify()expects the passed structbvec_iterto be an iterator over bio data, not integrity. So construct a separate databvec_iterwithout thebio_integrity_bytes()conversion and pass it tobio_integrity_verify()instead ofbip_iter.
Applied, thanks!
[1/1] bio-integrity-fs: pass data iter to bio_integrity_verify()
commit: 431e40042d3599559e588b8946bb28bd440b4f65
Best regards,
Signature · 1 line
Jens Axboe