From patchwork Fri Jun 1 13:04:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10443369 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 BEA65602BC for ; Fri, 1 Jun 2018 13:07:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1D9028D9F for ; Fri, 1 Jun 2018 13:07:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A49EA28DA5; Fri, 1 Jun 2018 13:07:53 +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 5C6CE28D9F for ; Fri, 1 Jun 2018 13:07:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752581AbeFANHa (ORCPT ); Fri, 1 Jun 2018 09:07:30 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:40755 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752156AbeFANFM (ORCPT ); Fri, 1 Jun 2018 09:05:12 -0400 Received: by mail-lf0-f65.google.com with SMTP id q11-v6so14743644lfc.7 for ; Fri, 01 Jun 2018 06:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2lFs4ND2R3NT+gfyHKmoqwi6f5lgpbkd6RubGeQ0UH8=; b=DYyXrE50k2jAGvSc2qkvJVlT3s9LHUovjxxvdhRdiocH4ck0pA4IuVq14+9Qk6ryOM QXtAWW21age/JNrS+eVrGBX24OnflYg2ymX2buWfHMij2rOztrsbN7qXwuIrAvrP48g5 q5Ys1TUho0EJ11FZVDVdRTVZYWyvqx4GapIgwIUSEDDEdvWc/BvVjnOv0FnLUOySCM6g V8ySKc268JiPzQjSFKANrJgvuXBQozr1zeeyUpz9LWjUQ1Ehs3iwM+JPYJ97gRMooR+l ZsTb+MpDvxpKLlbnwl32N6Gah8ygi5Oir/hCtpAabm9/ZuERAYCK62zkseLeKIVYFzuY e4Hg== 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=2lFs4ND2R3NT+gfyHKmoqwi6f5lgpbkd6RubGeQ0UH8=; b=DLD+d1b3ToRGPrx/yWIKn+ktVl9sqKxurI1megzUU8ad1XBnd0Ulvft+452ju7Ur2g mWcB0rS5Zajb9AcBz1cGUApREnt0SgltRua4llcff3551MS5nHtlhQGzaZvszB73fpQa s0/Cottfz5JM2+CEhPzl5KEiZy+fURizJ7Yt21KEQUSMkE6xs/zkO+K8sxTOLh0NrjKw OU0xVIxg8fZXj6Ipz4sLnofEZKP8uvGGhRwHovjQpMI4c7muXUNSbnpAmMFnsGRNBLwV 0bDQQ3ViuuWW3LwHzH2EnzI/8lj5T5ecDiW/3wIabLUVPqLEMDgBNx7TOxlLuvFaMsV1 BdQw== X-Gm-Message-State: ALKqPwcv13TcOzRFBSZ+qV6eSEufz8EbQ2+HLCJIyY2rlGbiak9pB6ve CCaZGwoHE+3DUzOMrz7QbVO6tCRI X-Google-Smtp-Source: ADUXVKIzu8+315jRrGNv8ryFguzpFWJ6gVuIVE8ZDJ6Vu1N16Yd0laKPGSkB+2nvJBLNJFEnYYiHXg== X-Received: by 2002:a19:4e86:: with SMTP id u6-v6mr6987278lfk.105.1527858310542; Fri, 01 Jun 2018 06:05:10 -0700 (PDT) Received: from Macroninja.cnexlabs.com (95-166-82-66-cable.dk.customer.tdc.net. [95.166.82.66]) by smtp.gmail.com with ESMTPSA id g5-v6sm303161lje.21.2018.06.01.06.05.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jun 2018 06:05:09 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, javier@cnexlabs.com, igor.j.konopko@intel.com, marcin.dziegielewski@intel.com, Hans Holmberg , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 14/18] lightnvm: pblk: fix smeta write error path Date: Fri, 1 Jun 2018 15:04:28 +0200 Message-Id: <20180601130432.30866-15-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180601130432.30866-1-mb@lightnvm.io> References: <20180601130432.30866-1-mb@lightnvm.io> 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: 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 Signed-off-by: Matias Bjørling --- 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 263da2e43567..e43093e27084 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); } @@ -1101,7 +1102,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);