Received: by 10.192.165.156 with SMTP id m28csp922291imm; Thu, 19 Apr 2018 09:42:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx4968Zk7Kd4ucJslErovyJn0t5rZ+ikHSSt+YUn2yKNniU6UYtnr67g983OQUcAtySuLC3bz X-Received: by 2002:a17:902:7684:: with SMTP id m4-v6mr2163412pll.340.1524156126742; Thu, 19 Apr 2018 09:42:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524156126; cv=none; d=google.com; s=arc-20160816; b=nHQnwdRKfXSCcE+QOE2UhJgoA1IEWq5RgzGmbrDDo3P3QPEsPXJ/dnB1q6r0dWzzRB ePMEah2Vpy/SIJwjntkdhPYVLZjH9qFrI6L6mJdUmvFWdMXuh5OqlrvsRnUz1HkFxVjy XRcm5qdQl2m2gg3s3fIXfytD1wkpbp+vDKzoqwo3LELwBiRiQuk2H4vORqW7U7wxosoJ 1ov0l48Q+CjsAo8v3hmvpfOfGIHAnyfo+Tb8yF9vWo8C7LbxaNpktSConW4GxhKm055N VkypJP5rlDZeR9KOjU3CpVXFdNhR7un+RC38BSm6C9P8xWEAXAW8lrPocjEWUZH7XHWM FMtA== 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=b9ZWRrv4A6KRejNHPl241laWYXU9LpZEp5b3UqKPEKw=; b=Rs2uEe5whzUEOJaT14wTOtUSrV/q0bg5+nTj2vPxytvC4sNiaQF/7VxF5Ica+nE6pv it0/4JOQh8NJCrhgX+qJ2gCZfwFfoFdk8TcvaTRsOxW4ZxdqcPGmYOU7Bi/LqWVq5j6p /hsplRVMze4FDdEEh2cNEfDQUb6w4h4HKLGSHO9pcNf0PswT8LZoGqkM+/9C5DGulRkf hhupRNi0Ux49QTYyZO7fVe3tDP9M4cv89nwHOvVZ2HOzdiO9L7oKJW0ujEI6cRnDvpfU HGEfsYbWxYMzUoUZTdEzSVNSlMfkRtLcOEBIERCmyOGcXJjEgQOg7YXehk9mFQy67hud rxHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@owltronix-com.20150623.gappssmtp.com header.s=20150623 header.b=L9k9TubE; 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 ay12-v6si3418754plb.554.2018.04.19.09.41.51; Thu, 19 Apr 2018 09:42:06 -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=L9k9TubE; 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 S1754142AbeDSQk0 (ORCPT + 99 others); Thu, 19 Apr 2018 12:40:26 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:38734 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754073AbeDSQkP (ORCPT ); Thu, 19 Apr 2018 12:40:15 -0400 Received: by mail-lf0-f65.google.com with SMTP id z130-v6so1106542lff.5 for ; Thu, 19 Apr 2018 09:40:14 -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=b9ZWRrv4A6KRejNHPl241laWYXU9LpZEp5b3UqKPEKw=; b=L9k9TubEoG2PefxWxxJLEtI24wBS28YYfUQXZoTxGSoz0J1b1mFqY0/4Yc7cqPXIL8 5LGdVQLDlj9JWEhXlD1ldBzW4tjj8yLdSaKA38Z9uXJbv+4A7neftSzMqpqE+4ErVV8/ 0w83a5KklWy04yuyqGOHQ7cYo5PI/X6h9USgNf5+BKf6eqbSwrr+oAlkk9LSNXJLVf+i SouCxtSr6x+aGcMzjTDEn8CLu59KwdeSj+kQ8R9lWNqj6d3af9JgAOyo/wDGK0P+1Lxp 7yNP5BJFUvL7u6glpyUVhRywKRtVyVYiHjS+iVfjLEPH6B7vjkikT5gFs//R0VSWW2Vk gEcw== 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=b9ZWRrv4A6KRejNHPl241laWYXU9LpZEp5b3UqKPEKw=; b=DcbbzX8Qja9nmQfWYIk9ZsbvtF4RdPVmWqdXiPid5aGgS8cd/ZqjtrtTKpxbGfY0cg ytabXUgsK7sWQYgOOWzlR1pcp9c2+gXbnPLtegPFxRlqh/tIysP7gjWYziIl4f8BCAdK EWBS2dB5nKKY264McvLpZRvz+Ge7AcRPk42XuhWhJdBBgmU72TdtYqcGF6iSaBrF51l/ 1vXVBLbnydLbRgnyvnX/HTJt0NX+EmFMw4WaHzYY++AxewU18RjMSqWUP9RDlzUxLlPR kkvKC5L3b7JiiqG2SehjIZqrpFaIrWorDicfzBoSK5UxkHesaV9bRcpXuFL4WbGVs3Hm Jn/A== X-Gm-Message-State: ALQs6tC6bXqwfmci/jR3yMbPiq6qOZOOp0vUkWK5XNTvsbODzqR/8D1C tj6Bnl/7N9jhexbC3OoKOr6VCg== X-Received: by 10.46.49.10 with SMTP id x10mr4588729ljx.132.1524156013937; Thu, 19 Apr 2018 09:40:13 -0700 (PDT) Received: from titan.bredbandsbolaget.se (c-b9b6e655.03-91-6d6c6d4.cust.bredbandsbolaget.se. [85.230.182.185]) by smtp.gmail.com with ESMTPSA id a21-v6sm831554lfl.15.2018.04.19.09.40.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Apr 2018 09:40:13 -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 3/3] lightnvm: pblk: fix smeta write error path Date: Thu, 19 Apr 2018 18:39:24 +0200 Message-Id: <1524155964-3743-4-git-send-email-hans.ml.holmberg@owltronix.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524155964-3743-1-git-send-email-hans.ml.holmberg@owltronix.com> References: <1524155964-3743-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 f6135e4..485fe8c 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