Skip to content

Commit

Permalink
bio-integrity: bio_trim should truncate integrity vector accordingly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Monakhov authored and Jens Axboe committed Jul 3, 2017
1 parent 32825c4 commit 376a78a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 376a78a

Please sign in to comment.