From patchwork Wed May 10 15:20:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Monakhov X-Patchwork-Id: 9720075 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A79360236 for ; Wed, 10 May 2017 15:21:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E05A28608 for ; Wed, 10 May 2017 15:21:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82D8628610; Wed, 10 May 2017 15:21:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 184AD28608 for ; Wed, 10 May 2017 15:21:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753534AbdEJPVE (ORCPT ); Wed, 10 May 2017 11:21:04 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36061 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753524AbdEJPVB (ORCPT ); Wed, 10 May 2017 11:21:01 -0400 Received: by mail-wm0-f67.google.com with SMTP id u65so524185wmu.3; Wed, 10 May 2017 08:21:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Sim82AdoRBLnsJ5/p52TOIJsuhBPWNWEzPauxdyHeV8=; b=T3xolYcvAQ8pIgoNQ3wZVNdCVMT992Ypy/fBmI3Zy6CedqDvdUxn45ZYy7XpUis1OZ bjwmgoAh6NahWHG/g20RLafo2xkBTf4RtiszQWP+kyBHnE5F4SCLbLgxOWUR3EHCtGf2 7bRBk0tNDmdaq7yEPyE2cgrH6jsfMvncNhIiAyWFeGr7ZV48XwYid8B7Be//KeFAkOJs GUQEE3ZN5RYFgdpKUw4ENgT3E/WUCBk6ztw72eL4e41dsXLwKhOQ8odxFK3FkbHVgI4T ihAohRarkJj6zNkSGFRWNwSYMV5WbP42tg1dtUa7wIEeOGiD7CsUFvpUaTbPFcKW/sWx eUJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Sim82AdoRBLnsJ5/p52TOIJsuhBPWNWEzPauxdyHeV8=; b=mZJXsVidlnvKMx6NSYvu5ZbaxMR7CBNUeVVCEBikxvvSSp98OAmr0vxFFmANcfr/Oa RaTKspspLxqOItvrxkQWSRgptYxLH/dfwjJYP5nw+gbhQKa8EDp0Oz/mBjenOSoXJ8Vj 3t2ldCFlEpEzIkkDvpojOJsPODsxT2kosCb+AuJNSuLsKElGuAVGWJAhNLAYz4jCwtf2 71cPY0eUdD8zlBZAEVhfYCIv491XtTcYSAMscRRkI922BwJMYVcpejEZdV7J9Zazfl0n OAAZBvjSwFy+lvHeN6jVIRhmLlmDEhMEGW2ypXD4qhPG/q6t9rXzD6tQEYk6IRoNhtkZ HGpg== X-Gm-Message-State: AODbwcCog2Beg1FPcRsI8zkiHRTFMGOzX70n03Vpe9yHLn2OCoa48z4z zGY9UxwqA+af4RCyBPc= X-Received: by 10.25.228.75 with SMTP id b72mr3292933lfh.177.1494429659239; Wed, 10 May 2017 08:20:59 -0700 (PDT) Received: from smtp.gmail.com (msk-vpn.virtuozzo.com. [195.214.232.6]) by smtp.gmail.com with ESMTPSA id d10sm627640lfb.38.2017.05.10.08.20.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 May 2017 08:20:58 -0700 (PDT) From: Dmitry Monakhov To: fstests@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, Dmitry Monakhov Subject: [PATCH 2/9] bio-integrity: bio_trim should truncate integrity vector accordingly Date: Wed, 10 May 2017 19:20:45 +0400 Message-Id: <1494429652-9488-3-git-send-email-dmonakhov@openvz.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1494429652-9488-1-git-send-email-dmonakhov@openvz.org> References: <1494429652-9488-1-git-send-email-dmonakhov@openvz.org> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen 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 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);