Received: by 10.192.165.148 with SMTP id m20csp4260875imm; Mon, 23 Apr 2018 22:58:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+9wphXHwOiqQSuSEg5unVFEKpJwLFHwKLgreWMNQRUB1jK8dV8EyLcb9YcykvXgvAl3s4P X-Received: by 2002:a17:902:6b86:: with SMTP id p6-v6mr24016043plk.32.1524549512097; Mon, 23 Apr 2018 22:58:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524549512; cv=none; d=google.com; s=arc-20160816; b=Gao+qgSbdHGnPvz3PtX9Hadb+esUDK5cX2UcE15swI1ADHuaYVUbTCchLRW3H8DinF YoscrVlM3HCQR+j4kj3owp5/YuDaZi+aQmd2buSNdyoX6G96vDhbcaQSAaLvuzdQb8pR JzeKFXjodZRs2VeHaFS4wTovnveEAiYRStHz54wZT6B98TIq4jw8v3zNA6uw3ZhLjx5f m9AfQyH/kO+OA8T3eEld1gI5OEB9ayrzf0BOnnCOMTszGeNyBgqk6dckmduaqu0oXHBy n3LHq6woWcAjqw6KEzKagEqRtlx+Nseivk0l13DQZS2hTUhV4kOWkb4lDHmFEmCHtnze Ib7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=LKo+aoH35uYoiHmpi4B2wxu5kJBUQUG7o8GxpajCO2Y=; b=XEQ9+QlwIuTHV5wsH2sUNScuupfMExF7nRaecxnN/9bsPRyGZBsH+aYZz7PCvpF19v RZBFH8A/eFQr0tJYM0gC2dhwXM7+0qlrojP0TaGlDnakkenlE2pPDqrhbVnbqCVSpeSf YNS/Wjx7ELzwOlYaywWiiW4aa+j65lpQQLRrtDFJ0+TQXc47qzrBJhwqs0obkHWwLQ/m M6ed+vx4l/86/zU0Mx7zNYE3MD6EVQQ+KKR9fa25VVrmL3oATUUZKZglODKC2KAtObe+ gLX5Kq9I49wKktxwaaI8U4qCmX6Yr/grKjJDumogvhMO4+xeHToLdOI8fdTG75lvwSob oI5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@owltronix-com.20150623.gappssmtp.com header.s=20150623 header.b=WuMt9M4w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d13si10902077pgn.334.2018.04.23.22.58.17; Mon, 23 Apr 2018 22:58:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@owltronix-com.20150623.gappssmtp.com header.s=20150623 header.b=WuMt9M4w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756099AbeDXFqA (ORCPT + 99 others); Tue, 24 Apr 2018 01:46:00 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:46425 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755966AbeDXFpw (ORCPT ); Tue, 24 Apr 2018 01:45:52 -0400 Received: by mail-wr0-f193.google.com with SMTP id d1-v6so47023324wrj.13 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=JsvawBEjx3PnqeRFIEEAhlpcvTz4nMY8C1y/FhgJNTrxAGvv0Pxo9m+wbu9AXsPeEf 2kiS71OOeogddti+FRgwHs30RmUPhpVx4Vl6uaC/nOBda0DpNL3QbrsDwMfiqQkmOpV6 Z4D4j+i7t0q5b9f6TE79Lvjw6XfzIvNhvLX2ojwQr7ePYf+l28HsIxuiy38NazdoNKcr iwAKpsLCfd0bt0SNVcYZ2C8VVbrzoKQqSkw8tD8mmeko7DfbjplQ56gteOII/Pyzxx/v Rk+ZbAm/6ovMJTeOfy4vLKtcJWnvBg5zeOPtrS1P9ycKfFToSq2HCIlJhp3iG2J2byfM sRHg== X-Gm-Message-State: ALQs6tBhwZtFgR9P5NOK1sXcUt4kjC8BA6GkAemhnNO8KD/Hz5zXVgWV SmvncuGJpt1xlrLOSjYSH7VJNrNkCRM= 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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); -- 2.7.4