Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752133AbdDCHZ2 (ORCPT ); Mon, 3 Apr 2017 03:25:28 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:35146 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751667AbdDCHXw (ORCPT ); Mon, 3 Apr 2017 03:23:52 -0400 From: Dmitry Monakhov To: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, martin.petersen@oracle.com Cc: Dmitry Monakhov Subject: [PATCH 3/7] bio-integrity: bio_trim should truncate integrity vector accordingly Date: Mon, 3 Apr 2017 11:23:28 +0400 Message-Id: <1491204212-9952-4-git-send-email-dmonakhov@openvz.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1491204212-9952-1-git-send-email-dmonakhov@openvz.org> References: <1491204212-9952-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: 473 Lines: 22 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