diff mbox

[2/9] bio-integrity: bio_trim should truncate integrity vector accordingly

Message ID 1494429652-9488-3-git-send-email-dmonakhov@openvz.org (mailing list archive)
State New, archived
Headers show

Commit Message

Dmitry Monakhov May 10, 2017, 3:20 p.m. UTC
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>
---
 block/bio.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/block/bio.c b/block/bio.c
index 888e780..2f01f1b 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1889,6 +1889,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);