From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752435AbdEBDrU (ORCPT ); Mon, 1 May 2017 23:47:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:34553 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752308AbdEBDqq (ORCPT ); Mon, 1 May 2017 23:46:46 -0400 From: NeilBrown To: Jens Axboe Date: Tue, 02 May 2017 13:42:26 +1000 Subject: [PATCH 11/13] bcache: use kmalloc to allocate bio in bch_data_verify() Cc: linux-block@vger.kernel.org, Ming Lei , linux-kernel@vger.kernel.org Message-ID: <149369654598.5146.245471167001845646.stgit@noble> In-Reply-To: <149369628671.5146.4865312503373040039.stgit@noble> References: <149369628671.5146.4865312503373040039.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This function allocates a bio, then a collection of pages. It copes with failure. It currently uses a mempool() to allocate the bio, but alloc_page() to allocate the pages. These fail in different ways, so the usage is inconsistent. Change the bio_clone() to bio_clone_kmalloc() so that no pool is used either for the bio or the pages. Reviewed-by: Christoph Hellwig Acked-by: Kent Overstreet Reviewed-by : Ming Lei Signed-off-by: NeilBrown --- drivers/md/bcache/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index 06f55056aaae..35a5a7210e51 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c @@ -110,7 +110,7 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio) struct bio_vec bv, cbv; struct bvec_iter iter, citer = { 0 }; - check = bio_clone(bio, GFP_NOIO); + check = bio_clone_kmalloc(bio, GFP_NOIO); if (!check) return; check->bi_opf = REQ_OP_READ;