From patchwork Fri Jan 5 13:16:18 2018 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: 10146477 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 6D7D460244 for ; Fri, 5 Jan 2018 13:17:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D4F21FFEB for ; Fri, 5 Jan 2018 13:17:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51905288BA; Fri, 5 Jan 2018 13:17:58 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 E2E2B1FFEB for ; Fri, 5 Jan 2018 13:17:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751861AbeAENRK (ORCPT ); Fri, 5 Jan 2018 08:17:10 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:40280 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752068AbeAENRD (ORCPT ); Fri, 5 Jan 2018 08:17:03 -0500 Received: by mail-wm0-f66.google.com with SMTP id f206so2406506wmf.5 for ; Fri, 05 Jan 2018 05:17:02 -0800 (PST) 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=Y8CxNFiQemZzJMxkLo4XMx7S2yJcpEzbnPxWsBT02jE=; b=ERzHTl4vRxincOrXx2hpAV32USMLNyIZxro1PAwpQBEj4zpM0DNSvreZyfjK5yu4kp CRYfRUJpPExPFgdxC2JGHfDIlFqRBP88oOWVcrkDxQq0F31CaV74lc8DT8GrBbfd7q1Q czol55nlJOzDpRGcsMXFmi1Z0P0VSoXs1Msyc= 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=Y8CxNFiQemZzJMxkLo4XMx7S2yJcpEzbnPxWsBT02jE=; b=psr755KygOWEKsCKT4P6FFXKjGpJrhL0Pzm8WnEiqQJmSnMSFMaxCIoUfStimD18Lf Pv4mLs5FxWS+ECyg7DqBKjcNOWyF17jRfBYT0SnLZCWNykfwuaW9z/SE8uAhhnCMc4qJ bVFeyKqXFMAyROZXqfMs4LRD13CK5Cpirwepb3fM/lnaTyAzHvqqaE0bS4kN+tiBLRCl IykTpAyBs2OeoJd0VZr9fiWKLxYBXBtL3s6jPURns/69tMDvSAn0O6QTHBAupm4OX+mk Lj2lSP3mNhgejEIPU36LlL+gEQbhAf0NTrPvjKXfZVY1VSELKRBWrCKWvXd0WoFh970A 5GoQ== X-Gm-Message-State: AKGB3mI0tuHU1wRpk+fR1LyTOH2FNE23prONp5kFrwbitL5l5ZgQSJY+ x+AuabPf7yqTamgrdAqxP1gacA== X-Google-Smtp-Source: ACJfBosE6ZzEqR1MCzymDqCjV6kgV6/IPY5XxhRDZB2CAAaVMohu8kfqZ/C+aCA1V1gxQja3rRj+6A== X-Received: by 10.80.151.10 with SMTP id c10mr4209358edb.82.1515158222377; Fri, 05 Jan 2018 05:17:02 -0800 (PST) Received: from skyninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id e46sm4228940edb.93.2018.01.05.05.17.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jan 2018 05:17:01 -0800 (PST) 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 22/25] lightnvm: pblk: free write buffer on init failure Date: Fri, 5 Jan 2018 14:16:18 +0100 Message-Id: <20180105131621.20808-23-m@bjorling.me> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20180105131621.20808-1-m@bjorling.me> References: <20180105131621.20808-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 Refactor the way we free the write buffer to ensure that all entries get freed in case of an error on the init sequence. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index 7e11926..8c40bc3 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -355,6 +355,8 @@ static void pblk_core_free(struct pblk *pblk) mempool_destroy(pblk->e_rq_pool); mempool_destroy(pblk->w_rq_pool); + pblk_rwb_free(pblk); + pblk_free_global_caches(pblk); } @@ -931,7 +933,6 @@ static void pblk_tear_down(struct pblk *pblk) pblk_pipeline_stop(pblk); pblk_writer_stop(pblk); pblk_rb_sync_l2p(&pblk->rwb); - pblk_rwb_free(pblk); pblk_rl_free(&pblk->rl); pr_debug("pblk: consistent tear down\n");