From: Dmitry Monakhov <dmonakhov@xxxxxxxxxx> Reviewed-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Hannes Reinecke <hare@xxxxxxxx> Reviewed-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> Signed-off-by: Dmitry Monakhov <dmonakhov@xxxxxxxxxx> Signed-off-by: Christoph Hellwig <hch@xxxxxx> --- block/bio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/bio.c b/block/bio.c index 9cf98b29588a..8cd995f7d3c0 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1894,6 +1894,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); -- 2.11.0