|
@@ -306,6 +306,8 @@ bool bio_integrity_prep(struct bio *bio)
|
|
if (bio_data_dir(bio) == WRITE) {
|
|
if (bio_data_dir(bio) == WRITE) {
|
|
bio_integrity_process(bio, &bio->bi_iter,
|
|
bio_integrity_process(bio, &bio->bi_iter,
|
|
bi->profile->generate_fn);
|
|
bi->profile->generate_fn);
|
|
|
|
+ } else {
|
|
|
|
+ bip->bio_iter = bio->bi_iter;
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
|
|
|
|
@@ -331,20 +333,14 @@ static void bio_integrity_verify_fn(struct work_struct *work)
|
|
container_of(work, struct bio_integrity_payload, bip_work);
|
|
container_of(work, struct bio_integrity_payload, bip_work);
|
|
struct bio *bio = bip->bip_bio;
|
|
struct bio *bio = bip->bip_bio;
|
|
struct blk_integrity *bi = blk_get_integrity(bio->bi_disk);
|
|
struct blk_integrity *bi = blk_get_integrity(bio->bi_disk);
|
|
- struct bvec_iter iter = bio->bi_iter;
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
* At the moment verify is called bio's iterator was advanced
|
|
* At the moment verify is called bio's iterator was advanced
|
|
* during split and completion, we need to rewind iterator to
|
|
* during split and completion, we need to rewind iterator to
|
|
* it's original position.
|
|
* it's original position.
|
|
*/
|
|
*/
|
|
- if (bio_rewind_iter(bio, &iter, iter.bi_done)) {
|
|
|
|
- bio->bi_status = bio_integrity_process(bio, &iter,
|
|
|
|
- bi->profile->verify_fn);
|
|
|
|
- } else {
|
|
|
|
- bio->bi_status = BLK_STS_IOERR;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ bio->bi_status = bio_integrity_process(bio, &bip->bio_iter,
|
|
|
|
+ bi->profile->verify_fn);
|
|
bio_integrity_free(bio);
|
|
bio_integrity_free(bio);
|
|
bio_endio(bio);
|
|
bio_endio(bio);
|
|
}
|
|
}
|