Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1668536

[PATCH 11/13] bcache: use kmalloc to allocate bio in bch_data_verify()

From NeilBrown <neilb@suse.com>
Newsgroups linux.kernel
Subject [PATCH 11/13] bcache: use kmalloc to allocate bio in bch_data_verify()
Date 2017-06-18 06:50 +0200
Message-ID <tTAjT-sG-15@gated-at.bofh.it> (permalink)
References <tTAad-oX-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <hch@lst.de>
Acked-by: Kent Overstreet <kent.overstreet@gmail.com>
Reviewed-by : Ming Lei <ming.lei@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.com>
---
 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;

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/13] block: assorted cleanup for bio splitting and cloning. NeilBrown <neilb@suse.com> - 2017-06-18 06:40 +0200
  [PATCH 06/13] rbd: use bio_clone_fast() instead of bio_clone() NeilBrown <neilb@suse.com> - 2017-06-18 06:50 +0200
  [PATCH 10/13] xen-blkfront: remove bio splitting. NeilBrown <neilb@suse.com> - 2017-06-18 06:50 +0200
  [PATCH 12/13] block: remove bio_clone() and all references. NeilBrown <neilb@suse.com> - 2017-06-18 06:50 +0200
  [PATCH 11/13] bcache: use kmalloc to allocate bio in  bch_data_verify() NeilBrown <neilb@suse.com> - 2017-06-18 06:50 +0200
  [PATCH 09/13] lightnvm/pblk-read: use bio_clone_fast() NeilBrown <neilb@suse.com> - 2017-06-18 06:50 +0200
  [PATCH 13/13] block: don't check for BIO_MAX_PAGES in  blk_bio_segment_split() NeilBrown <neilb@suse.com> - 2017-06-18 06:50 +0200
  [PATCH 04/13] blk: use non-rescuing bioset for q->bio_split. NeilBrown <neilb@suse.com> - 2017-06-18 06:50 +0200
  [PATCH 07/13] drbd: use bio_clone_fast() instead of bio_clone() NeilBrown <neilb@suse.com> - 2017-06-18 06:50 +0200
  [PATCH 03/13] blk: make the bioset rescue_workqueue optional. NeilBrown <neilb@suse.com> - 2017-06-18 06:50 +0200
  [PATCH 05/13] block: Improvements to bounce-buffer handling NeilBrown <neilb@suse.com> - 2017-06-18 06:50 +0200
  [PATCH 08/13] pktcdvd: use bio_clone_fast() instead of bio_clone() NeilBrown <neilb@suse.com> - 2017-06-18 06:50 +0200
  Re: [PATCH 00/13] block: assorted cleanup for bio splitting and  cloning. Jens Axboe <axboe@kernel.dk> - 2017-06-18 20:50 +0200
    Re: [PATCH 00/13] block: assorted cleanup for bio splitting and cloning. NeilBrown <neilb@suse.com> - 2017-06-18 23:40 +0200

csiph-web