From patchwork Wed Jun 27 20:12:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10492589 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 BF8E260386 for ; Wed, 27 Jun 2018 20:12:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C87B229FAF for ; Wed, 27 Jun 2018 20:12:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC89F29F95; Wed, 27 Jun 2018 20:12:33 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, 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 22F0329FAF for ; Wed, 27 Jun 2018 20:12:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966071AbeF0UMc (ORCPT ); Wed, 27 Jun 2018 16:12:32 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:14036 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966011AbeF0UMc (ORCPT ); Wed, 27 Jun 2018 16:12:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1530130352; x=1561666352; h=from:to:cc:subject:date:message-id; bh=yjT9ROlaMuMF1ovacteBcRdOHNX2qirUMpUz3MOLizk=; b=HcaYw9FdG7/rnheeopCjf3leiuJNDkghhnIeg1ds+livNJD12F7RlaUW TNF0Uf46CWOQ/lECC1B2J73mt09LGewG2DA26zom4MkiNSc5MuLcsotrU 9cUQl0ilslhLcpywIe9ha1Ma8JlVzPVKn26+KM2hRfD3LPhgE3yHCqu1c asFzWdNkS4T5r57Hj968KGyBPyK+CoJcSg8NDjFZlamjIVkAOI6tvy29m ziuAiqveiF4Cfi/m8xjb0rGToq+qt4YYqrqY0EvET8ysc8wWqezuj7lfW g+UFfjxfmEBbLdwebaxaE7VDRuB70D/jVL9MaPoD/2gMwJxAtnRp7E2ZM g==; X-IronPort-AV: E=Sophos;i="5.51,280,1526313600"; d="scan'208";a="83341318" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Jun 2018 04:12:32 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 27 Jun 2018 13:01:48 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jun 2018 13:12:32 -0700 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Mike Snitzer , Ming Lei , Hannes Reinecke , Johannes Thumshirn Subject: [PATCH] block: Make __bio_clone_fast() copy bi_vcnt Date: Wed, 27 Jun 2018 13:12:31 -0700 Message-Id: <20180627201231.15641-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.17.1 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Although __bio_clone_fast() copies bi_io_vec, it does not copy bi_vcnt, the number of elements in bi_io_vec[] that contains data. Copy bi_vcnt such that code that needs this member behaves identically for original and for cloned requests. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Mike Snitzer Cc: Ming Lei Cc: Hannes Reinecke Cc: Johannes Thumshirn Acked-by: Mike Snitzer --- block/bio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/bio.c b/block/bio.c index f7e3d88bd0b6..55f8e0dedd69 100644 --- a/block/bio.c +++ b/block/bio.c @@ -605,6 +605,7 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src) bio->bi_opf = bio_src->bi_opf; bio->bi_write_hint = bio_src->bi_write_hint; bio->bi_iter = bio_src->bi_iter; + bio->bi_vcnt = bio_src->bi_vcnt; bio->bi_io_vec = bio_src->bi_io_vec; bio_clone_blkcg_association(bio, bio_src);