From patchwork Fri May 6 18:02:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 9035671 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D6213BF29F for ; Fri, 6 May 2016 18:12:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B8152024D for ; Fri, 6 May 2016 18:12:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 38C69200E9 for ; Fri, 6 May 2016 18:12:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758625AbcEFSDi (ORCPT ); Fri, 6 May 2016 14:03:38 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:37035 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758224AbcEFSDh (ORCPT ); Fri, 6 May 2016 14:03:37 -0400 Received: by mail-wm0-f42.google.com with SMTP id a17so89980598wme.0 for ; Fri, 06 May 2016 11:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YYSe4+oa9TVAA5Gs7oLTDrVztDlyCyDM1/+lZTsTHlk=; b=cUi5dh+Jo37UNHD7JPcd7FYE7Da3kGa3s2edRsHNupnihNGfmkHdW+oFZ5q9R8h1ss yOTLndLySn9PhiN4KJkAU9DYKKmZycnwaUtg53aGX6NB4CxRXwRNcACufNtG9PsJ5y8A 1r/MbiWzZmzTVClzVUq9AATmNah7KtGfsdK7M= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=YYSe4+oa9TVAA5Gs7oLTDrVztDlyCyDM1/+lZTsTHlk=; b=AJYtJGXqaiKdZGEqowV0nDLtrLty7iHxb8MwAoJ0FlIZsnCXX2pdp9YNviK+P6nLup 1pODT+dxeu9NeoP/0bRouAAwrIfdBQckHOCKs5+K1mT9AWwICFFXu9rSKRuyawVA7DKF OEjBUVWRhCYrLtCq7pK2pUmiUUIBO+L8rzzvVz7vuVV7/TglJvzaskWTBI91hZZDExTK 9oo5MhwnRjbIRy1q/WsrK1r0XT69OVAd1wsVsEHqlvd1CrskQUDajGHkXGsMU4mhO2Cp 0zwCJqb+dB5kEaVFif9sNp+4OXzFmPoI2F3cjw8VQYxw2UmRUqEVvwaJq4pgaauKBz4+ Rf3Q== X-Gm-Message-State: AOPr4FV4P7z1bOaiSfJYi3c2dDKGbmD3IYy8m7JGVd7oH41VjlxhMmfwyQR28/MKdhj7KA== X-Received: by 10.28.154.73 with SMTP id c70mr11343342wme.12.1462557815569; Fri, 06 May 2016 11:03:35 -0700 (PDT) Received: from Macroninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id kz1sm16076559wjc.46.2016.05.06.11.03.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 May 2016 11:03:34 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 02/28] lightnvm: handle submit_io failure Date: Fri, 6 May 2016 20:02:55 +0200 Message-Id: <1462557801-24974-3-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1462557801-24974-1-git-send-email-m@bjorling.me> References: <1462557801-24974-1-git-send-email-m@bjorling.me> 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=-8.9 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 The device ->submit_io() callback might fail to submit I/O to device. In that case, the nvm_submit_ppa function should not wait for completion. Instead return the ->submit_io() error. Reviewed by: Johannes Thumshirn Signed-off-by: Matias Bjørling --- drivers/lightnvm/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 0dc9a80..c2ef53a 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -351,6 +351,11 @@ int nvm_submit_ppa(struct nvm_dev *dev, struct ppa_addr *ppa, int nr_ppas, nvm_generic_to_addr_mode(dev, &rqd); ret = dev->ops->submit_io(dev, &rqd); + if (ret) { + nvm_free_rqd_ppalist(dev, &rqd); + bio_put(bio); + return ret; + } /* Prevent hang_check timer from firing at us during very long I/O */ hang_check = sysctl_hung_task_timeout_secs;