Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1627005 > unrolled thread
| Started by | NeilBrown <neilb@suse.com> |
|---|---|
| First post | 2017-04-20 07:50 +0200 |
| Last post | 2017-04-21 20:40 +0200 |
| Articles | 4 — 4 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 09/11] bcache: use kmalloc to allocate bio in bch_data_verify() NeilBrown <neilb@suse.com> - 2017-04-20 07:50 +0200
Re: [PATCH 09/11] bcache: use kmalloc to allocate bio in bch_data_verify() Kent Overstreet <kent.overstreet@gmail.com> - 2017-04-21 13:40 +0200
Re: [PATCH 09/11] bcache: use kmalloc to allocate bio in bch_data_verify() Christoph Hellwig <hch@infradead.org> - 2017-04-21 13:40 +0200
Re: [PATCH 09/11] bcache: use kmalloc to allocate bio in bch_data_verify() Ming Lei <tom.leiming@gmail.com> - 2017-04-21 20:40 +0200
| From | NeilBrown <neilb@suse.com> |
|---|---|
| Date | 2017-04-20 07:50 +0200 |
| Subject | [PATCH 09/11] bcache: use kmalloc to allocate bio in bch_data_verify() |
| Message-ID | <tyd8D-4Wq-35@gated-at.bofh.it> |
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.
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;
[toc] | [next] | [standalone]
| From | Kent Overstreet <kent.overstreet@gmail.com> |
|---|---|
| Date | 2017-04-21 13:40 +0200 |
| Message-ID | <tyF4S-5fu-11@gated-at.bofh.it> |
| In reply to | #1627005 |
On Thu, Apr 20, 2017 at 03:38:50PM +1000, NeilBrown wrote:
> 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.
>
> Signed-off-by: NeilBrown <neilb@suse.com>
Acked-by: Kent Overstreet <kent.overstreet@gmail.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;
>
>
[toc] | [prev] | [next] | [standalone]
| From | Christoph Hellwig <hch@infradead.org> |
|---|---|
| Date | 2017-04-21 13:40 +0200 |
| Message-ID | <tyF4S-5fu-25@gated-at.bofh.it> |
| In reply to | #1627005 |
Looks fine, Reviewed-by: Christoph Hellwig <hch@lst.de>
[toc] | [prev] | [next] | [standalone]
| From | Ming Lei <tom.leiming@gmail.com> |
|---|---|
| Date | 2017-04-21 20:40 +0200 |
| Subject | Re: [PATCH 09/11] bcache: use kmalloc to allocate bio in bch_data_verify() |
| Message-ID | <tyLDk-LM-31@gated-at.bofh.it> |
| In reply to | #1627005 |
On Thu, Apr 20, 2017 at 1:38 PM, NeilBrown <neilb@suse.com> wrote: > 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. > > Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by : Ming Lei <ming.lei@redhat.com> Thanks, Ming Lei
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web