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 <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Signed-off-by: Dmitry Monakhov <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Dmitry Monakhov authored and 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.