Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755474AbdDDS4y (ORCPT ); Tue, 4 Apr 2017 14:56:54 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35049 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755440AbdDDS4v (ORCPT ); Tue, 4 Apr 2017 14:56:51 -0400 From: Dmitry Monakhov To: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, martin.petersen@oracle.com Cc: Dmitry Monakhov Subject: [PATCH 2/9] bio-integrity: bio_trim should truncate integrity vector accordingly Date: Tue, 4 Apr 2017 22:56:34 +0400 Message-Id: <1491332201-26926-3-git-send-email-dmonakhov@openvz.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1491332201-26926-1-git-send-email-dmonakhov@openvz.org> References: <1491332201-26926-1-git-send-email-dmonakhov@openvz.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 517 Lines: 23 Reviewed-by: Christoph Hellwig Signed-off-by: Dmitry Monakhov --- block/bio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/bio.c b/block/bio.c index e75878f..fa84323 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1907,6 +1907,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.9.3