Skip to content

Commit 3991657

Browse files
Anuj Guptaaxboe
authored andcommitted
block: set bip_vcnt correctly
Set the bip_vcnt correctly in bio_integrity_init_user and bio_integrity_copy_user. If the bio gets split at a later point, this value is required to set the right bip_vcnt in the cloned bio. Signed-off-by: Anuj Gupta <[email protected]> Signed-off-by: Kanchan Joshi <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 5b026e3 commit 3991657

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

block/bio-integrity.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ static int bio_integrity_copy_user(struct bio *bio, struct bio_vec *bvec,
254254

255255
bip->bip_flags |= BIP_INTEGRITY_USER | BIP_COPY_USER;
256256
bip->bip_iter.bi_sector = seed;
257+
bip->bip_vcnt = nr_vecs;
257258
return 0;
258259
free_bip:
259260
bio_integrity_free(bio);
@@ -275,6 +276,7 @@ static int bio_integrity_init_user(struct bio *bio, struct bio_vec *bvec,
275276
bip->bip_flags |= BIP_INTEGRITY_USER;
276277
bip->bip_iter.bi_sector = seed;
277278
bip->bip_iter.bi_size = len;
279+
bip->bip_vcnt = nr_vecs;
278280
return 0;
279281
}
280282

0 commit comments

Comments
 (0)