From patchwork Fri Jun 1 14:41:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10443661 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 6C50D603D7 for ; Fri, 1 Jun 2018 14:47:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F5732860A for ; Fri, 1 Jun 2018 14:47:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5401328944; Fri, 1 Jun 2018 14:47:19 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 05F522860A for ; Fri, 1 Jun 2018 14:47:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752144AbeFAOp6 (ORCPT ); Fri, 1 Jun 2018 10:45:58 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:33976 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752108AbeFAOoA (ORCPT ); Fri, 1 Jun 2018 10:44:00 -0400 Received: by mail-lf0-f49.google.com with SMTP id o9-v6so15205273lfk.1 for ; Fri, 01 Jun 2018 07:44:00 -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=S2gZVm/mITWPss8nf5AU/5ciN/zKUYdyVWKMs8Y35B0=; b=0+Hbh18Uu+48lLs0wp4VRhn9wwjISM9CMQ7w8SKq7I81Vf1JeAtTyV0J4nBKRLAbRD NBhikVFRpf0kofLPphZ5kv1mjK2zCmM3A/Yu+om7bj+DYUYkSZWqxeTyP4794Muwr5L2 clZjInc1C226JEHSnk5vQVtd/2WmjLYFc8vYB9lIZAw79+uliq8r1hWWlBbaYwnDOa+t x8JDn/JWLb5OEu38NKWgrVgqWwpH2RuqaNQ/qUaUHmR73xW/koTMOG4MkaK2EumFSrIr XWqFZwglgpmKJM/IrpRwKU09Myd/oERz3GFIVzP/6lqy0Ka8815FPVBaLvBTRv4PVGJu 0fbg== 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=S2gZVm/mITWPss8nf5AU/5ciN/zKUYdyVWKMs8Y35B0=; b=SBkXPLz6gyRU643+yGmTN4c4PA/5HAaGPBm0irTGq+AtV7ie2Id699lB1IVhnhOTAT mIJv5FtuOsS66ZbWgAXMtz/8byhTUoLtcMXn5zQQQXZDnm1Tu3hbqVoKH1KtMTckkfw6 40Vw9t7VuLdCkkfsd56FCOYQ8SxyzjLUXVQ1vkwmX1Pt8hTZepVqY+qMVbTMDJQkl41v o3n2Y6hO3RM5vnAOhNmQZLs8tdlfHVhw5/zqHN8vyZFo/CRsWRhsmoQW84coUXi4rgTS 9sFsdcZ3lXlGjGBLUeqlKIxgonzjidAJfooZEa6gJn/ARRczOy9y0jssfxwdVxPPDBxw Vlfg== X-Gm-Message-State: ALKqPwedEoRpQhn7rM89s3RLQfpQIYcXxOisQw/6X9WtR+LOzERQEBAH z2JMq6A9VtN92MMQh/UDuhBWAw== X-Google-Smtp-Source: ADUXVKLINzm/rPr4yfozGpH+ggCjZFMrUEWx0Vqt1RRKrBKNY8G2TLK8LzbHh8uTWm2zP0W3Zcx3Eg== X-Received: by 2002:a19:4c08:: with SMTP id z8-v6mr7201363lfa.11.1527864239428; Fri, 01 Jun 2018 07:43:59 -0700 (PDT) Received: from Macroninja.cnexlabs.com (95-166-82-66-cable.dk.customer.tdc.net. [95.166.82.66]) by smtp.gmail.com with ESMTPSA id e65-v6sm356488lff.13.2018.06.01.07.43.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jun 2018 07:43:58 -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, javier@cnexlabs.com, igor.j.konopko@intel.com, marcin.dziegielewski@intel.com, =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 05/10] lightnvm: fix partial read error path Date: Fri, 1 Jun 2018 16:41:09 +0200 Message-Id: <20180601144114.17490-6-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180601144114.17490-1-mb@lightnvm.io> References: <20180601144114.17490-1-mb@lightnvm.io> 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: Igor Konopko When error occurs during bio_add_page on partial read path, pblk tries to free pages twice. Signed-off-by: Igor Konopko Signed-off-by: Marcin Dziegielewski Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-read.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/lightnvm/pblk-read.c b/drivers/lightnvm/pblk-read.c index 38f89a84ce5e..f770fd113ffe 100644 --- a/drivers/lightnvm/pblk-read.c +++ b/drivers/lightnvm/pblk-read.c @@ -256,7 +256,7 @@ static int pblk_partial_read_bio(struct pblk *pblk, struct nvm_rq *rqd, new_bio = bio_alloc(GFP_KERNEL, nr_holes); if (pblk_bio_add_pages(pblk, new_bio, GFP_KERNEL, nr_holes)) - goto err; + goto err_add_pages; if (nr_holes != new_bio->bi_vcnt) { pr_err("pblk: malformed bio\n"); @@ -347,10 +347,10 @@ static int pblk_partial_read_bio(struct pblk *pblk, struct nvm_rq *rqd, return NVM_IO_OK; err: - pr_err("pblk: failed to perform partial read\n"); - /* Free allocated pages in new bio */ - pblk_bio_free_pages(pblk, bio, 0, new_bio->bi_vcnt); + pblk_bio_free_pages(pblk, new_bio, 0, new_bio->bi_vcnt); +err_add_pages: + pr_err("pblk: failed to perform partial read\n"); __pblk_end_io_read(pblk, rqd, false); return NVM_IO_ERR; }