From patchwork Wed May 23 12:29:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Konopko X-Patchwork-Id: 10421127 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 CC89D6032A for ; Wed, 23 May 2018 12:30:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCD5528F72 for ; Wed, 23 May 2018 12:30:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1AFF28F7B; Wed, 23 May 2018 12:30:49 +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, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham 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 5807F28F72 for ; Wed, 23 May 2018 12:30:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932089AbeEWMas (ORCPT ); Wed, 23 May 2018 08:30:48 -0400 Received: from mga09.intel.com ([134.134.136.24]:25419 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932070AbeEWMas (ORCPT ); Wed, 23 May 2018 08:30:48 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 May 2018 05:30:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,433,1520924400"; d="scan'208";a="61034409" Received: from gklab-106-154.igk.intel.com ([10.102.106.154]) by orsmga002.jf.intel.com with ESMTP; 23 May 2018 05:30:46 -0700 From: Igor Konopko To: mb@lightnvm.io Cc: linux-block@vger.kernel.org, marcin.dziegielewski@intel.com, Igor Konopko Subject: [PATCH 2/3] lightnvm: Handling when whole line is bad Date: Wed, 23 May 2018 14:29:55 +0200 Message-Id: <20180523122956.24137-3-igor.j.konopko@intel.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180523122956.24137-1-igor.j.konopko@intel.com> References: <20180523122956.24137-1-igor.j.konopko@intel.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 When all the blocks (chunks) in line are marked as bad (offline) we shouldn't try to read smeta during init process. Currently we are trying to do so by passing -1 as PPA address, what causes multiple warnings, that we issuing IOs to out-of-bound PPAs. Signed-off-by: Igor Konopko Signed-off-by: Marcin Dziegielewski --- drivers/lightnvm/pblk-core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c index 6d21f9dbca5f..5d197f19b77b 100644 --- a/drivers/lightnvm/pblk-core.c +++ b/drivers/lightnvm/pblk-core.c @@ -867,6 +867,11 @@ int pblk_line_read_smeta(struct pblk *pblk, struct pblk_line *line) { u64 bpaddr = pblk_line_smeta_start(pblk, line); + if (bpaddr == -1) { + /* Whole line is bad - do not try to read smeta. */ + return 1; + } + return pblk_line_submit_smeta_io(pblk, line, bpaddr, PBLK_READ_RECOV); }