From patchwork Wed Sep 6 15:01:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= X-Patchwork-Id: 9940949 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 B0E1F60216 for ; Wed, 6 Sep 2017 15:01:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4D8A28C1A for ; Wed, 6 Sep 2017 15:01:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9903028C21; Wed, 6 Sep 2017 15:01:47 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham 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 C4EB928C16 for ; Wed, 6 Sep 2017 15:01:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932720AbdIFPBX (ORCPT ); Wed, 6 Sep 2017 11:01:23 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37514 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932785AbdIFPBR (ORCPT ); Wed, 6 Sep 2017 11:01:17 -0400 Received: by mail-wm0-f50.google.com with SMTP id u26so32206418wma.0 for ; Wed, 06 Sep 2017 08:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CflD1qFeIHzX7yI1gn1PWRe6+T9B3EkH0TX8If2yGbY=; b=yY/D1NXlLFh5aYz42WeVMFevjpo+jAysEREOZvzv+q/UOf0p994rxU4wOZvYTsW0ti znMoRiNbCJFJ2DupiHrPGjLxc9yyp3oQmZ7Ppncnf2qr2a8NzY61J5YWbs4ha4XI0SSk JGmYBlcl/K2C6XaT0f2mSJC74yJ1eXhDk3RSyWMVt23laYR0ROYF5w28RXT913EbyCjg 06+/vZJQ2v/qNBD/PQ273POqVIm4pjjjF+D5HHbZdxO1JDCPDwPFGR9fp2BuB+xBOui6 VY2cqvxycjbVNjTKE1rk+MHZd0k2+xXJAeNe+T3uInKIVWE5KRtguMqnwfIFg2Apj400 z8eg== 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=CflD1qFeIHzX7yI1gn1PWRe6+T9B3EkH0TX8If2yGbY=; b=WMsBH4S2v25FyTMS4lYDj6iFHoYNJ3NEdQqZhYCRiH2iL5GlqG9/4XgrP/omW/Z6mH e/aNrNbYz9hwqDbU0oWB42EqgKB8wBwXSiXqY06kFX9ZhRhNmb+ANAa4irFw1Nb34YZD JxiQLKtJdXE2Q9boODYSTdTieUKk0t8cBVCA9vVFMfr666CNYAX5Ljy2evTlnTLgoywh P7A1Rpqfs3bMkElIzaZgY1GmWizGcImmW7j+fY3f5HgHbEgylqozxAqlGGOBmez7dJHu 34rsQX0/taCTIV3q1jrrEr+WEUZzjyekzDGbaYWJA6qiQ3l0xkaqDodVeJDq1c+iEUoC /GDg== X-Gm-Message-State: AHPjjUg2KAUGFfKL3MBnhrMNkWSbds7gjKWHKMm8PiPEakNvwDp9P23Y JsUAxOGWr1ofPZBC X-Google-Smtp-Source: ADKCNb5kWohd4Pmc31lV5jTbXe7QupFd/r1sYo3jv1bU3u8norLwbmFYGGDsMryIfxYyXTBwvG2Ccw== X-Received: by 10.80.186.100 with SMTP id 33mr32879eds.240.1504710076603; Wed, 06 Sep 2017 08:01:16 -0700 (PDT) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id p16sm1408260eda.78.2017.09.06.08.01.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Sep 2017 08:01:16 -0700 (PDT) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io, 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: [PATCH 3/6] lightnvm: pblk: use right flag for GC allocation Date: Wed, 6 Sep 2017 17:01:03 +0200 Message-Id: <1504710066-4699-4-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504710066-4699-1-git-send-email-javier@cnexlabs.com> References: <1504710066-4699-1-git-send-email-javier@cnexlabs.com> 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 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 Reviewed-by: Johannes Thumshirn --- 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;