Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2998733imm; Thu, 24 May 2018 20:51:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoqzJ+j3AklKCyzpTjHjmJ+L7w9i5y/c14wW7+O2/4W/jU8G1TDlvGA4cdKdB7H5etSZn/p X-Received: by 2002:a17:902:8d8e:: with SMTP id v14-v6mr797615plo.387.1527220264941; Thu, 24 May 2018 20:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527220264; cv=none; d=google.com; s=arc-20160816; b=kkWxZY+AtdAcjL3/L7f4oJ5dYN0AQxiFlZKf2s3gJw+8J1DgV020xg8GiTZjYvSV8k DnIkG7Y1NVE8kgGnwvObW5VP2ynXX28xiAFsE7f/eW7ahEZ8crTSH972K7HAo2Yls1VP 3WGwm7mVZoNN81Md3BBl3R5qiZrjTMZWXkv5LmrKmXbOqOUZVFw93dn5nAgU4lAqOXk6 dCEqj0KmEfvVQ9C3C1M0xbBtXKKYr7f7twstu+X6IK7/H6uGoxeYx2+5DrbY96it9paE bJHDIcq/WWir/Do1wKjslunduGZhxdbCUT1pHSZwbLSM6H9QLVLWxrHbRCyzz9VEAsdP iZGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=eVHo6V5RT9UQDTNNcV3lg5fKvDxDCUiow6D3Fud2myo=; b=b51QyEU3Ts08FEqhOc3GbgBtINwZKvoCcHLAf8M89BuPutxRcpwcp3PtxrahXCUxDa toJoN3cb1meK8e4e8To/jxzCuDKVUOAayBLOljUHrySlIrLwOvATF03nq1716lPGm8ox 1iknhCsha629606a+gNp92vTTMCQKtd8vth9Sthvn13sqWx2qLtxD6zAdxX5X416gijz JkgJbt7Jgn0DnYmj6EdroLRSQLzZoYoV3JtaapiN8483gX5nA+EzsJUDfJjo9vROXsbT ohwbnexOSLTbFtIWznd2PSxLb8fg0QBg2ctiRI8itFv9WZmAX/7ugNXotXNstkK7ZDSp /8Qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i67-v6si22775735pfi.95.2018.05.24.20.50.50; Thu, 24 May 2018 20:51:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935597AbeEYDt5 (ORCPT + 99 others); Thu, 24 May 2018 23:49:57 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41438 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935358AbeEYDtz (ORCPT ); Thu, 24 May 2018 23:49:55 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 893C4401EF26; Fri, 25 May 2018 03:49:54 +0000 (UTC) Received: from localhost (ovpn-12-30.pek2.redhat.com [10.72.12.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 83D9E111765C; Fri, 25 May 2018 03:49:44 +0000 (UTC) From: Ming Lei To: Jens Axboe , Christoph Hellwig , Alexander Viro , Kent Overstreet Cc: David Sterba , Huang Ying , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Theodore Ts'o , "Darrick J . Wong" , Coly Li , Filipe Manana , Ming Lei Subject: [RESEND PATCH V5 16/33] dm: clone bio via bio_clone_seg_bioset Date: Fri, 25 May 2018 11:46:04 +0800 Message-Id: <20180525034621.31147-17-ming.lei@redhat.com> In-Reply-To: <20180525034621.31147-1-ming.lei@redhat.com> References: <20180525034621.31147-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 25 May 2018 03:49:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 25 May 2018 03:49:54 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'ming.lei@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The incoming bio will become very big after multipage bvec is enabled, so we can't clone bio page by page. This patch uses the introduced bio_clone_seg_bioset(), so the incoming bio can be cloned successfully. This way is safe because device mapping won't modify the bio vector on the cloned multipage bio. Signed-off-by: Ming Lei --- drivers/md/dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f1db181e082e..425e99e20f5c 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1581,8 +1581,8 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md, * the usage of io->orig_bio in dm_remap_zone_report() * won't be affected by this reassignment. */ - struct bio *b = bio_clone_bioset(bio, GFP_NOIO, - md->queue->bio_split); + struct bio *b = bio_clone_seg_bioset(bio, + GFP_NOIO, md->queue->bio_split); ci.io->orig_bio = b; bio_advance(bio, (bio_sectors(bio) - ci.sector_count) << 9); bio_chain(b, bio); -- 2.9.5