bio-integrity: bio_trim should truncate integrity vector accordingly

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Dmitry Monakhov 2017-06-29 11:31:08 -07:00 committed by Jens Axboe
parent 32825c45ff
commit 376a78abf5

View File

@ -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);