From: Anuj Gupta Date: Wed, 26 Jun 2024 10:06:52 +0000 (+0530) Subject: block: set bip_vcnt correctly X-Git-Tag: v6.11-rc1~80^2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3991657ae7074c3c497bf095093178bed37ea1b4;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Kanchan Joshi Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20240626100700.3629-3-anuj20.g@samsung.com Signed-off-by: Jens Axboe --- diff --git a/block/bio-integrity.c b/block/bio-integrity.c index ad296849aa2a9..eb3d7bbe1fe83 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -254,6 +254,7 @@ static int bio_integrity_copy_user(struct bio *bio, struct bio_vec *bvec, bip->bip_flags |= BIP_INTEGRITY_USER | BIP_COPY_USER; bip->bip_iter.bi_sector = seed; + bip->bip_vcnt = nr_vecs; return 0; free_bip: bio_integrity_free(bio); @@ -275,6 +276,7 @@ static int bio_integrity_init_user(struct bio *bio, struct bio_vec *bvec, bip->bip_flags |= BIP_INTEGRITY_USER; bip->bip_iter.bi_sector = seed; bip->bip_iter.bi_size = len; + bip->bip_vcnt = nr_vecs; return 0; }