From patchwork Sat May 4 18:37:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10929939 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1208E17E6 for ; Sat, 4 May 2019 18:38:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 044D328820 for ; Sat, 4 May 2019 18:38:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E27C128830; Sat, 4 May 2019 18:38:42 +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=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 8B11328820 for ; Sat, 4 May 2019 18:38:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727253AbfEDSib (ORCPT ); Sat, 4 May 2019 14:38:31 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:35468 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726552AbfEDSia (ORCPT ); Sat, 4 May 2019 14:38:30 -0400 Received: by mail-lf1-f65.google.com with SMTP id j20so6548128lfh.2 for ; Sat, 04 May 2019 11:38:29 -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=a9RavLGoIs/lnDK5Lu6hOyR7V69/kOZA5XlkRY8NIyQ=; b=aEli/RHJ/0kQtLT28mmdqbdwfQ4kVP0Ocn6go9/A66iEW33ePeTgOQcGjpHXhMsTOx wMLTfazjmoJr/0DILN4xRci//Zir/PATnYdDLo9Q0o6i2Nm6pcjOhhNIiv7GlHZDTMWV q6qBAwEbi5hABxneTtdsGMXpYRYYu0V3vZ0BzW+ppwRb0ZzX04uh8w0yzolMtZ/PLmB4 zlbsnR+YS55wyUjxDIib0jkWg/wMpqzCNriH4VBaivpDFOHjoeYgf0Qg4ohMrSGRsMzY 1sVAG92FtAOeusA9O0dUWyWHhhM9rRlQfEngv1CmQOQRuFF3YPzb6Toe19/oJ/BSw2TO 1UCA== 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=a9RavLGoIs/lnDK5Lu6hOyR7V69/kOZA5XlkRY8NIyQ=; b=XRM5cqfC0xuNLsypqlVT7kjUmOtclvi9glvGXIqTwCVM5hZgqiSZBHc7Ub6nRitKW/ wYnKwFgu3Na68MKGHT6G+KofuCque2MnWAcOWBJBUdwbHUe2TNHWaO2sJXmzvDBZ3VnI 3jvdFh25C7xgZC2w40FoF2qqF4ZHxC38N4iwYyLl9/fCQnMVOBpmi7DGwrknMvq+0wXe Anb7zxPKbpcNFTQheaFNJ/GoW9UEPpaHQAUX114VRvgE5bb1izROiyTpycaPfDhHDX7W Diu/dhMmvvy+EzVs0LccTzZ9UEGsQrhVDUFrLoZVkZ0k/KFCsk91GECnfyEZbXpr59u7 oIYg== X-Gm-Message-State: APjAAAWeNbqAE7Plcjx3rLW5BkCbTPYBgv59vZmFZYkaxS0gd1P8ls4A //FAV2P+m+Bjy7Vyzh1BycR8nQ== X-Google-Smtp-Source: APXvYqzJ3dlSV6eQsQZzATJQq1zPRD5tE6hnql1aWMg4ppBR7Kgyqaf4MeAyrbqGi/v9F6wemsMtbw== X-Received: by 2002:ac2:457a:: with SMTP id k26mr5602909lfm.161.1556995108764; Sat, 04 May 2019 11:38:28 -0700 (PDT) Received: from skyninja.webspeed.dk (2-111-91-225-cable.dk.customer.tdc.net. [2.111.91.225]) by smtp.gmail.com with ESMTPSA id q21sm1050260lfa.84.2019.05.04.11.38.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 May 2019 11:38:28 -0700 (PDT) From: =?utf-8?q?Matias_Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Konopko , =?utf-8?q?Matias_Bj=C3=B8rling?= Subject: [GIT PULL 02/26] lightnvm: pblk: rollback on error during gc read Date: Sat, 4 May 2019 20:37:47 +0200 Message-Id: <20190504183811.18725-3-mb@lightnvm.io> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190504183811.18725-1-mb@lightnvm.io> References: <20190504183811.18725-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: Igor Konopko A line is left unsigned to the blocks lists in case pblk_gc_line returns an error. This moves the line back to be appropriate list, which can then be picked up by the garbage collector. Signed-off-by: Igor Konopko Reviewed-by: Hans Holmberg Reviewed-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-gc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c index 901e49951ab5..65692e6d76e6 100644 --- a/drivers/lightnvm/pblk-gc.c +++ b/drivers/lightnvm/pblk-gc.c @@ -358,8 +358,13 @@ static int pblk_gc_read(struct pblk *pblk) pblk_gc_kick(pblk); - if (pblk_gc_line(pblk, line)) + if (pblk_gc_line(pblk, line)) { pblk_err(pblk, "failed to GC line %d\n", line->id); + /* rollback */ + spin_lock(&gc->r_lock); + list_add_tail(&line->list, &gc->r_list); + spin_unlock(&gc->r_lock); + } return 0; }