From patchwork Tue Apr 24 05:45:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hans Holmberg X-Patchwork-Id: 10358657 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 BABE1601BE for ; Tue, 24 Apr 2018 05:46:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD6DC28CEB for ; Tue, 24 Apr 2018 05:46:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A26FF28CED; Tue, 24 Apr 2018 05:46:38 +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 3E36028CEB for ; Tue, 24 Apr 2018 05:46:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756110AbeDXFqZ (ORCPT ); Tue, 24 Apr 2018 01:46:25 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:37606 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755809AbeDXFpw (ORCPT ); Tue, 24 Apr 2018 01:45:52 -0400 Received: by mail-wr0-f194.google.com with SMTP id c14-v6so6943823wrd.4 for ; Mon, 23 Apr 2018 22:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=owltronix-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LKo+aoH35uYoiHmpi4B2wxu5kJBUQUG7o8GxpajCO2Y=; b=WuMt9M4wL8cGvFu57alMHlaVLIQh2pT5m5wtZOJoqJYfAETO5gjzyP15XsA/M1iZ2a rBo0GUoYNXEOmLKc21uww+YHJzy6Ou7LDHdJgeuPmUj6p821E7KpSL/YWc9LFLeiUPwh +/PHVG46oAKLpUCR/YppAehoer0xs071MfaOeHuuCnrJKbf8JkSfsiiyNU1S7qoABcgl Z6k1BNCHkwMeEpKAT0/y1MsfPe8SEHVapk5o+BdQPRQeCzqrepph9xcj6OBx8e9059Lp ZURMq75729GE37vruwjRiyTvy06asKd9o24GVf0/wAX79USqZh0imVYdDcpxZmXR/oH3 8/zA== 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; bh=LKo+aoH35uYoiHmpi4B2wxu5kJBUQUG7o8GxpajCO2Y=; b=skrxHNVtqpw0Xcx132cK15fKZJMQ/efzZam/XcuzNtI2EJNavmlspzFCmAjZHkSxF4 NN/W2mhrPh5Vlv195xM+uXoEDGGrP4LTvWrEmtbfJwuvmBTgonQSTAzsxagP4lO9LyAi girZfSf9VZdkPEbDOdgqn6HIBC4h4gMAAfGcnWvFfxUn/YRqHFIfkLMDOZJnf/mPyJkp txAaJ37N8riVsjbIc3PHmyGsPz11PGWO7K+qFRoisWbf0yZumYYy+5AXF4VFuxJREBFB bh9UzWzydQ2pSKTTX3qq62+3UUyYVri0QuP6clKODMJUQWv6AqpGz62vr0OirusO6VDE f88w== X-Gm-Message-State: ALQs6tCgjrYOposo0ruP7tOl1iogie2cRvZ1CAE751qrBvUPfDV3S54g WzFDDqfk4CF6+IV5xorWOQo3aQ== X-Google-Smtp-Source: AB8JxZqsadGHfHHs3aWllz7cBf0LFuMl6dC4S8cpSf1s8ln2U1Nsl/oVuNZilqnXQlHv//54KZJnQw== X-Received: by 10.28.94.201 with SMTP id s192mr11532542wmb.42.1524548751371; Mon, 23 Apr 2018 22:45:51 -0700 (PDT) Received: from titan.bredbandsbolaget.se ([86.123.183.96]) by smtp.gmail.com with ESMTPSA id v66sm16470609wmd.41.2018.04.23.22.45.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Apr 2018 22:45:50 -0700 (PDT) From: Hans Holmberg To: Matias Bjorling Cc: linux-block@vger.kernel.org, Javier Gonzales , linux-kernel@vger.kernel.org, Hans Holmberg Subject: [PATCH v2 3/3] lightnvm: pblk: fix smeta write error path Date: Tue, 24 Apr 2018 08:45:32 +0300 Message-Id: <1524548732-4326-4-git-send-email-hans.ml.holmberg@owltronix.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524548732-4326-1-git-send-email-hans.ml.holmberg@owltronix.com> References: <1524548732-4326-1-git-send-email-hans.ml.holmberg@owltronix.com> 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: Hans Holmberg Smeta write errors were previously ignored. Skip these lines instead and throw them back on the free list, so the chunks will go through a reset cycle before we attempt to use the line again. Signed-off-by: Hans Holmberg Reviewed-by: Javier González --- drivers/lightnvm/pblk-core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c index 413cf3b..dec1bb4 100644 --- a/drivers/lightnvm/pblk-core.c +++ b/drivers/lightnvm/pblk-core.c @@ -849,9 +849,10 @@ static int pblk_line_submit_smeta_io(struct pblk *pblk, struct pblk_line *line, atomic_dec(&pblk->inflight_io); if (rqd.error) { - if (dir == PBLK_WRITE) + if (dir == PBLK_WRITE) { pblk_log_write_err(pblk, &rqd); - else if (dir == PBLK_READ) + ret = 1; + } else if (dir == PBLK_READ) pblk_log_read_err(pblk, &rqd); } @@ -1120,7 +1121,7 @@ static int pblk_line_init_bb(struct pblk *pblk, struct pblk_line *line, if (init && pblk_line_submit_smeta_io(pblk, line, off, PBLK_WRITE)) { pr_debug("pblk: line smeta I/O failed. Retry\n"); - return 1; + return 0; } bitmap_copy(line->invalid_bitmap, line->map_bitmap, lm->sec_per_line);