linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Javier González" <jg@lightnvm.io>
To: mb@lightnvm.io, axboe@fb.com
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Javier González" <javier@cnexlabs.com>,
	"Matias Bjørling" <matias@cnexlabs.com>
Subject: [PATCH 3/6] lightnvm: pblk: use right flag for GC allocation
Date: Wed,  6 Sep 2017 17:01:03 +0200	[thread overview]
Message-ID: <1504710066-4699-4-git-send-email-javier@cnexlabs.com> (raw)
In-Reply-To: <1504710066-4699-1-git-send-email-javier@cnexlabs.com>

The data buffer for the GC path allocates virtual memory through
vmalloc. When this change was introduced, a flag signaling kmalloc'ed
memory was wrongly introduced. Use the right flag when creating a bio
from this buffer.

Fixes: de54e703a422 ("lightnvm: pblk: use vmalloc for GC data buffer")
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
---
 drivers/lightnvm/pblk-read.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/lightnvm/pblk-read.c b/drivers/lightnvm/pblk-read.c
index d682e89e6493..ee8efb55b330 100644
--- a/drivers/lightnvm/pblk-read.c
+++ b/drivers/lightnvm/pblk-read.c
@@ -499,7 +499,7 @@ int pblk_submit_read_gc(struct pblk *pblk, u64 *lba_list, void *data,
 
 	data_len = (*secs_to_gc) * geo->sec_size;
 	bio = pblk_bio_map_addr(pblk, data, *secs_to_gc, data_len,
-						PBLK_KMALLOC_META, GFP_KERNEL);
+						PBLK_VMALLOC_META, GFP_KERNEL);
 	if (IS_ERR(bio)) {
 		pr_err("pblk: could not allocate GC bio (%lu)\n", PTR_ERR(bio));
 		goto err_free_dma;
@@ -519,7 +519,7 @@ int pblk_submit_read_gc(struct pblk *pblk, u64 *lba_list, void *data,
 	if (ret) {
 		bio_endio(bio);
 		pr_err("pblk: GC read request failed\n");
-		goto err_free_dma;
+		goto err_free_bio;
 	}
 
 	if (!wait_for_completion_io_timeout(&wait,
@@ -541,10 +541,13 @@ int pblk_submit_read_gc(struct pblk *pblk, u64 *lba_list, void *data,
 	atomic_long_sub(*secs_to_gc, &pblk->inflight_reads);
 #endif
 
+	bio_put(bio);
 out:
 	nvm_dev_dma_free(dev->parent, rqd.meta_list, rqd.dma_meta_list);
 	return NVM_IO_OK;
 
+err_free_bio:
+	bio_put(bio);
 err_free_dma:
 	nvm_dev_dma_free(dev->parent, rqd.meta_list, rqd.dma_meta_list);
 	return NVM_IO_ERR;
-- 
2.7.4

  parent reply	other threads:[~2017-09-06 15:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-06 15:01 [PATCH 0/6] lightnvm: pblk bug fixes for 4.14 Javier González
2017-09-06 15:01 ` [PATCH 1/6] lightnvm: pblk: check for failed mempool alloc Javier González
2017-09-06 15:08   ` Johannes Thumshirn
2017-09-06 15:09     ` Jens Axboe
2017-09-06 15:12       ` Javier González
2017-09-06 15:13         ` Jens Axboe
2017-09-06 15:14           ` Javier González
2017-09-06 15:20           ` Jens Axboe
2017-09-06 18:28             ` Javier González
2017-09-06 15:12       ` Johannes Thumshirn
2017-09-06 15:01 ` [PATCH 2/6] lightnvm: pblk: initialize debug stat counter Javier González
2017-09-06 15:15   ` Johannes Thumshirn
2017-09-06 15:01 ` Javier González [this message]
2017-09-06 15:19   ` [PATCH 3/6] lightnvm: pblk: use right flag for GC allocation Johannes Thumshirn
2017-09-06 15:01 ` [PATCH 4/6] lightnvm: pblk: free padded entries in write buffer Javier González
2017-09-06 15:22   ` Johannes Thumshirn
2017-09-06 15:01 ` [PATCH 5/6] lightnvm: pblk: fix write I/O sync stat Javier González
2017-09-06 15:23   ` Johannes Thumshirn
2017-09-06 15:01 ` [PATCH 6/6] lightnvm: pblk: avoid deadlock on low LUN config Javier González

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1504710066-4699-4-git-send-email-javier@cnexlabs.com \
    --to=jg@lightnvm.io \
    --cc=axboe@fb.com \
    --cc=javier@cnexlabs.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matias@cnexlabs.com \
    --cc=mb@lightnvm.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).