Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1976911imm; Sat, 9 Jun 2018 05:35:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLRc8eJd4VZin1DnrGPWxODlDP4c62Ug71OvgZjOS8CCw4/mMG2TQ7s0yrVsgcj6zYfapH7 X-Received: by 2002:a62:a054:: with SMTP id r81-v6mr10004660pfe.10.1528547710921; Sat, 09 Jun 2018 05:35:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528547710; cv=none; d=google.com; s=arc-20160816; b=BbfBTOEZEtPTJi6+8q6baic6exvkp3zkyLDJhF1xVCokh3X7fxkGbww4+lLlZVJGUL BYT7ob9FMfoxUFZh72RfE1pCGEw9KjkH7vrdIXTos9Le+lK2IdQEcS3ZdUEmw6COBJVO LkiCrufuqrtNL0LhozkkM7dbBPPDAh5LRKcVdgGfaYouWfpqkIkvdu6eiVqJZDyw2zYo cTa6ih0Pkjl9ZvjDHVBia2WzTTgiTKI6E3JoFLIKkqs4zEUlZBFneqxJjhvHouQYz/PX T088XBl459gy7xMeCyXTz7dVe1xO9VVBONOzxSnPH1+RTMsNUnp4AEm7kxYIMGE0eg01 lSsw== 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=lFfiA/zrzblmkv6ko0VgS+vN7k7MyNAj9De7dyxAY6M=; b=0vJt8SssPLT2yCorsFXNr4/66fugSKcv2nqv6vPjXZRIeGN+Myn+1ncuTI5UXsad4i Gp4UrlQSSkQJfZKOuvtOOO2T/VSacZCkyA+4t003thqrRhRwKiKrLmQTFPpPvZaLNFb4 bAVmUgy/8nXq59BN/QhbRuzKa5NC+WEoJjQD1SpOrU7g8FEW17VfJrfrvs+RvC1Z6bgw MOX5FJm6VvDGCHExyeVE4LNh4S0ogoQMWbVHA83gRz3+ETA+iBDPFdzgl9n1npCdYvQT HYnZEmgwm3xdXkhb7ELY0YaEORTAG5bIhRiUZDzVAmd9ZxSHsft2y24rT/azFBqcPRcE TvPg== 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 i65-v6si21032449pfg.218.2018.06.09.05.34.56; Sat, 09 Jun 2018 05:35:10 -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 S1753528AbeFIMdv (ORCPT + 99 others); Sat, 9 Jun 2018 08:33:51 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36032 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753248AbeFIMdt (ORCPT ); Sat, 9 Jun 2018 08:33:49 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DBA74859A5; Sat, 9 Jun 2018 12:33:48 +0000 (UTC) Received: from localhost (ovpn-12-40.pek2.redhat.com [10.72.12.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFD9D2166BB2; Sat, 9 Jun 2018 12:33:40 +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 , Randy Dunlap , Ming Lei Subject: [PATCH V6 16/30] dm: clone bio via bio_clone_chunk_bioset Date: Sat, 9 Jun 2018 20:30:00 +0800 Message-Id: <20180609123014.8861-17-ming.lei@redhat.com> In-Reply-To: <20180609123014.8861-1-ming.lei@redhat.com> References: <20180609123014.8861-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Sat, 09 Jun 2018 12:33:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Sat, 09 Jun 2018 12:33:49 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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_chunk_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 98dff36b89a3..13ca3574d972 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1582,8 +1582,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_chunk_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