From patchwork Sat Oct 29 08:08:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9403343 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 13F9E60587 for ; Sat, 29 Oct 2016 08:24:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0096C2A13D for ; Sat, 29 Oct 2016 08:24:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9B432A5F2; Sat, 29 Oct 2016 08:24:20 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 A30822A13D for ; Sat, 29 Oct 2016 08:24:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034175AbcJ2IYD (ORCPT ); Sat, 29 Oct 2016 04:24:03 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35233 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034290AbcJ2IPB (ORCPT ); Sat, 29 Oct 2016 04:15:01 -0400 Received: by mail-pf0-f195.google.com with SMTP id s8so3382914pfj.2; Sat, 29 Oct 2016 01:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fePcn2hO4vGxYl1TZDAt16t0KfB5qaJnxqqIWPppio8=; b=wNVwEglqxQIZjGIaPm0fSIgmGSRvYlOMLwW9QHSfNkI5MAK4jmI6h6DikWHX8fyLsE vwvFKiHY/QlvGDoLx8zvrvUeC3Rvf+Ixwgd3qvSCWf/QyMA+8PHk9WRnDGfXZlMzj57O gTI3v/5gJaBc7GsolBCZ7RoDFbFCMIV1xD4RAa1pvoc+A0FmGb12SCrfzM5RUbGuTcWJ km/k5rboagpGznmiSX0uzUBtaT4GE8tr4kXHGd9wxHWXprBfVToHy/0bgQFmreAfdWhq cmFajeCuVKDgJxtqOcQNGHFzf+RNfXgPJ2JgdCGzwwDXgwSIAjTHkzoGOUmNk/HYsL7f cnbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fePcn2hO4vGxYl1TZDAt16t0KfB5qaJnxqqIWPppio8=; b=fbxhGDPEcJlPH9vF5MxIEIXF19pMh9cVGcaQplSHdei9Qi1ADvdM+PHa7bsdSSKVvJ Qi+KLiSwJuTZUblIbWRsvvwTP8c5YVGEGYwzoRmqt3MYREFw91je54fzsHVK4L4eZjh5 4naN+erqJVS+s6/nYteVRvYnC0zGBGltqfCBbxRjEabiYSXTWlUycNEj40v7tiW644mI r8/KZarQy91Fm/qiZgKLDYHpsE+0Q7enn0aEm7FzAahYDKW0m5qYuQwACEu2ZdS2Iv3Z uoJ9nQ6RXpNRIz8/vE5Ea/lDBVVk+btoMHwT9/LFupyVpjJNgjs13ZjsoHV7SxGEo7UH 1HHw== X-Gm-Message-State: ABUngvfU6LojDS0SjyBG2I+Kp4I0DAio6yXyDWKmsZcXlj5Ow9c8WClAYRE2vgqUty4q+g== X-Received: by 10.98.192.135 with SMTP id g7mr31841876pfk.58.1477728900642; Sat, 29 Oct 2016 01:15:00 -0700 (PDT) Received: from localhost ([45.34.23.101]) by smtp.gmail.com with ESMTPSA id x123sm9151784pfb.95.2016.10.29.01.14.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Oct 2016 01:15:00 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , "Kirill A . Shutemov" , Ming Lei , Kent Overstreet , Shaohua Li , Mike Christie , Hannes Reinecke , Guoqing Jiang , linux-bcache@vger.kernel.org (open list:BCACHE (BLOCK LAYER CACHE)), linux-raid@vger.kernel.org (open list:SOFTWARE RAID (Multiple Disks) SUPPORT) Subject: [PATCH 39/60] bcache: debug: switch to bio_clone_sp() Date: Sat, 29 Oct 2016 16:08:38 +0800 Message-Id: <1477728600-12938-40-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477728600-12938-1-git-send-email-tom.leiming@gmail.com> References: <1477728600-12938-1-git-send-email-tom.leiming@gmail.com> 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 The cloned bio has to be singlepage bvec based, so use bio_clone_sp(), and the allocated bvec table is enough for hold the bvecs because QUEUE_FLAG_SPLIT_MP is set for bcache. Signed-off-by: Ming Lei --- drivers/md/bcache/debug.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index 71a9f05918eb..0735015b0842 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c @@ -111,12 +111,10 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio) struct bvec_iter iter, citer = { 0 }; /* - * Once multipage bvec is supported, the bio_clone() - * has to make sure page count in this bio can be held - * in the new cloned bio because each single page need - * to assign to each bvec of the new bio. + * QUEUE_FLAG_SPLIT_MP can make the cloned singlepage + * bvecs to be held in the allocated bvec table. */ - check = bio_clone(bio, GFP_NOIO); + check = bio_clone_sp(bio, GFP_NOIO); if (!check) return; bio_set_op_attrs(check, REQ_OP_READ, READ_SYNC);