From patchwork Fri Oct 13 12:46:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 10004643 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 8497D60360 for ; Fri, 13 Oct 2017 13:01:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7700429002 for ; Fri, 13 Oct 2017 13:01:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BFF329060; Fri, 13 Oct 2017 13:01:07 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable 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 18F4429002 for ; Fri, 13 Oct 2017 13:01:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758255AbdJMNAv (ORCPT ); Fri, 13 Oct 2017 09:00:51 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:53795 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758084AbdJMMrU (ORCPT ); Fri, 13 Oct 2017 08:47:20 -0400 Received: by mail-wm0-f65.google.com with SMTP id q132so21527538wmd.2 for ; Fri, 13 Oct 2017 05:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MbqePtIt76sds74mWMkpA336sjqRXp1Y2ROihsBM090=; b=EQO7+OzkgSA5s3ZMHQ9/J7UFu8lKR6kLbHZUekO62fHfl129pHFLORzDLE/8zFKpjO rwQcOyW/2sfRKNuxHvT/XaUA+cRapn04tE+PC4tXav0NBE9HY6qA6Qey4KO4zVsPcULk e4Seh5f5Z329JyIDn0pRVXG5Pmps4byAJFFws= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MbqePtIt76sds74mWMkpA336sjqRXp1Y2ROihsBM090=; b=Xsl9d7GItTD18iE90aJEQ8PzYg0C9ocQanwPesX+InEoZXB4ROb6urjd//al4FIgPA gYLoMJtZtLandLEu/HVNjTeiOOCvbEaeCEi1Uy2PhzwyvontvaIwN++NV5M0FRS/AUDa U896ab5Ihtp5CRjk2yBEX7werjPVzce05DVYhxZ4Z0W9TD/wwhf/5ppEOWqhXzjDmDA8 gjp7+rBSmkrVcunmuklYAF6eKkm+vkSwIFH+GBaWA6tjQkwfceyjp7yLZFpPtZRnOKYe Cj3u1bJLTyPMZ0EhHtpvKAfFT+MoPRZ5OSSH7e/fwvTQx3AqBpJSYJzZVSgzdXMAGfud wQww== X-Gm-Message-State: AMCzsaU4T2H1ZOFYySEXwPCNhWKY8KAXarAZMD0aKdJopR7tlLw7CoqG OmfmS8/mWHQ+7qgfNwRkr18vzg== X-Google-Smtp-Source: AOwi7QBzJKg2Do00bA774VHQVOmBVc1JntKQhpUEsz923Z1QMp7DqR1R3Zhtqq4bftM+L2srumFy9Q== X-Received: by 10.80.163.215 with SMTP id t23mr2064001edb.244.1507898838841; Fri, 13 Oct 2017 05:47:18 -0700 (PDT) Received: from skyninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id p91sm735012edp.69.2017.10.13.05.47.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 05:47:18 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 13/58] lightnvm: pblk: use right flag for GC allocation Date: Fri, 13 Oct 2017 14:46:02 +0200 Message-Id: <20171013124647.32668-14-m@bjorling.me> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171013124647.32668-1-m@bjorling.me> References: <20171013124647.32668-1-m@bjorling.me> MIME-Version: 1.0 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 From: Javier González 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 Signed-off-by: Matias Bjørling --- 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 d682e89..ee8efb5 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;