From: Dmitry Monakhov Date: Thu, 29 Jun 2017 18:31:08 +0000 (-0700) Subject: bio-integrity: bio_trim should truncate integrity vector accordingly X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=376a78abf5cc721a86ed42a1a24044d35fb8d2a8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git bio-integrity: bio_trim should truncate integrity vector accordingly Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Signed-off-by: Dmitry Monakhov Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe --- diff --git a/block/bio.c b/block/bio.c index 1cfcd0df3f30..5b4b32a2f8d0 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1900,6 +1900,10 @@ void bio_trim(struct bio *bio, int offset, int size) bio_advance(bio, offset << 9); bio->bi_iter.bi_size = size; + + if (bio_integrity(bio)) + bio_integrity_trim(bio, 0, size); + } EXPORT_SYMBOL_GPL(bio_trim);