From patchwork Tue Dec 29 05:50:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenwei Tao X-Patchwork-Id: 7928031 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 3C8309F349 for ; Tue, 29 Dec 2015 05:50:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D12D201CD for ; Tue, 29 Dec 2015 05:50:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A32B7200F3 for ; Tue, 29 Dec 2015 05:50:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753150AbbL2Fup (ORCPT ); Tue, 29 Dec 2015 00:50:45 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:35914 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753149AbbL2Fuo (ORCPT ); Tue, 29 Dec 2015 00:50:44 -0500 Received: by mail-pa0-f47.google.com with SMTP id yy13so27307999pab.3; Mon, 28 Dec 2015 21:50:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=dG0Fb0cLAus1JYmkjf0tKH5L9aN6SEvsdwyw70xzcwc=; b=IWC3vdHrZvQmVTDbzwUvhYq6XBIc7SiUg7EWshr0RGDbyE56FqMrPwNIWDIo7X4+MZ 4W0mbh79Ari/UhliyE0SKUycXz7R8NmNRtMSlRmHBZ/4FMZuAr2JpY0ti9CCKx/fdrOS 1hFs3lJdM1hwm3jiw6wO/uRedUCb4+qUM3pBRC8Em9OIOtXlKQZ5A6qlkbm3iG5gfsRZ oYp7hTO4xT8tzzRDmtU6m8CsWshadCSc7it/A1s9xUOpqqZwZFAeK/wJOz+TGxctTlF2 6zTZ6oriYNif2WTsuW/kzNVcc0hO46VvJimdDk9c+CTATJuVq4XZ/ssg/PiFeve71QeV pJcQ== X-Received: by 10.66.140.79 with SMTP id re15mr81718829pab.127.1451368244073; Mon, 28 Dec 2015 21:50:44 -0800 (PST) Received: from localhost.localdomain.com ([111.204.49.2]) by smtp.gmail.com with ESMTPSA id 11sm53269625pfq.90.2015.12.28.21.50.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Dec 2015 21:50:43 -0800 (PST) From: Wenwei Tao To: mb@lightnvm.io Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Subject: [PATCH] lightnvm: check bi_error in gc Date: Tue, 29 Dec 2015 13:50:12 +0800 Message-Id: <1451368212-20076-1-git-send-email-ww.tao0320@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 We should check last io compeltion status before start another one. Signed-off-by: Wenwei Tao --- drivers/lightnvm/rrpc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index c0886a8..d40c140 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -328,6 +328,10 @@ try: goto finished; } wait_for_completion_io(&wait); + if (bio->bi_error) { + rrpc_inflight_laddr_release(rrpc, rqd); + goto finished; + } bio_reset(bio); reinit_completion(&wait); @@ -350,6 +354,8 @@ try: wait_for_completion_io(&wait); rrpc_inflight_laddr_release(rrpc, rqd); + if (bio->bi_error) + goto finished; bio_reset(bio); }