From patchwork Mon Feb 1 13:10:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= X-Patchwork-Id: 8179281 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A3CA29F4DD for ; Mon, 1 Feb 2016 13:11:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CAFF32020F for ; Mon, 1 Feb 2016 13:11:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4D5A4200BE for ; Mon, 1 Feb 2016 13:11:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932485AbcBANK0 (ORCPT ); Mon, 1 Feb 2016 08:10:26 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:36673 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932321AbcBANKW (ORCPT ); Mon, 1 Feb 2016 08:10:22 -0500 Received: by mail-wm0-f45.google.com with SMTP id p63so69614920wmp.1 for ; Mon, 01 Feb 2016 05:10:22 -0800 (PST) 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:mime-version:content-type :content-transfer-encoding; bh=Chhi35n1ZqY7Hrgn7qUujJv7uBHzjsflB6LKxE9ecdk=; b=lzq6uhA0TJAh7lm+Tijns7tDqHVBtMlFgxQ1M6g/i0bn5Vl3Jd3zdsBxWlmVpZCgF4 U9mxOa1DeDvJz3RhDPzabr9fGbhMMGfZUydtuihpOqEfGMkAlCmKpM5cpy1DEQ0jl5dp UAAjhMwS+n0eKvDILlZgURmQwEspQynsLQOeDANQRQB8SVbI3HQEwjwlUqovZ60vGzHE izgSCmCAGnRC3I2ipqzvvO57Uyl7Sx302RIwK9yuj4j6dxVV25MJSJ0SNxg5imjf3Qva uvnikpkzqDNc9T54LiycyHMM0Kbe9LyW+lyeB7vrQuwV6Fpw21HS1C+rxHw/jRHPoYci 4jMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=Chhi35n1ZqY7Hrgn7qUujJv7uBHzjsflB6LKxE9ecdk=; b=Z1b0kBC9tUA4xCIFyigaU0kEuveGTAbskkvHa23U/hgNAxdi2EyFysEscp+q2a+JED 60QjugkTnGErtvzndptW2tK31Xpd1Nr3yZDf6HdBOGdufvYYiCfqctGwdPgVT1Y5Kge1 cAy13E+J8jJCF5JZFsSUAx7Ep0jwuvVMS5oBfayPDGQ1+Dmt55IFONWRHMDhcKNVQu5Y drnjU+nPOPmwgtonWCEmEue9z6vATvEfUCMcORSLO3Jo2+VAStdJHoDgZlp5GMBRIM8Q e+x92qfqKzZGJeWpJ8lcTGwDg6CrKP2eXfetzbepHQEoc9SjixHYf+xW8qbNckQRP4aU k+kA== X-Gm-Message-State: AG10YOTzj38jdFbjn2l1Z7PS71AI/eJcdFgAPKnciIJp6O8+VXdHBLeZtFuN4Ri86FmgMg== X-Received: by 10.194.78.175 with SMTP id c15mr22871953wjx.16.1454332221277; Mon, 01 Feb 2016 05:10:21 -0800 (PST) Received: from localhost.localdomain (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id ei9sm29027474wjd.40.2016.02.01.05.10.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 05:10:20 -0800 (PST) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH] lightnvm: invalidate addresses on multipage fail Date: Mon, 1 Feb 2016 14:10:02 +0100 Message-Id: <1454332202-13368-1-git-send-email-javier@javigon.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If a page mapping fails when mapping several pages in a single write bio request, make sure that already mapped pages are invalidated. Since other legit mappings coming from a different bio request might have occurred, rolling back the failed bio is a difficult, unnecessary overhead; in part because when a mapping fails something bad has happened already. Still, invalidating pages in the failed bio will help GC. Signed-off-by: Javier González --- drivers/lightnvm/rrpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index c4d0b04..29befe9 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -730,6 +730,7 @@ static int rrpc_read_ppalist_rq(struct rrpc *rrpc, struct bio *bio, } else { BUG_ON(is_gc); rrpc_unlock_laddr(rrpc, r); + rrpc_invalidate_range(rrpc, laddr, i + 1); nvm_dev_dma_free(rrpc->dev, rqd->ppa_list, rqd->dma_ppa_list); return NVM_IO_DONE;