From patchwork Tue Apr 5 14:55:27 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: 8752871 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 41D689F7C9 for ; Tue, 5 Apr 2016 14:58:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FFFA202BE for ; Tue, 5 Apr 2016 14:58:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85CD120389 for ; Tue, 5 Apr 2016 14:58:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932942AbcDEO5x (ORCPT ); Tue, 5 Apr 2016 10:57:53 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:32948 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758667AbcDEO4N (ORCPT ); Tue, 5 Apr 2016 10:56:13 -0400 Received: by mail-wm0-f49.google.com with SMTP id f198so35797164wme.0 for ; Tue, 05 Apr 2016 07:56:13 -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=DrCu014o2/8P7YCJOS8vYBvxuhDZaKvVmwk3U+MGlO0=; b=uDLkanjOnR+rPD9yG5eeN5eZVQq04AyIkqElD20Jeg9ZYyew8Lqr9zMJZIhZBvL56L RDZV2eQuKHWp/mfxwh3cWBVlcbiMib/3oQOdsN9Wm2cYKvvrfpHct8RCoul8Q4xaRLeI 2+7B6Ms5NNjK9Q9+B0jB1hO6BI5Kp4jVwdi2E= 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=DrCu014o2/8P7YCJOS8vYBvxuhDZaKvVmwk3U+MGlO0=; b=j3c5rmXagFoiHhGGO+6XgUxipPVHIlIG9icWsvq/qNpQxnB3avgcZ1qAF8soDUPIxt JUHfhiXeUz8ke0d7FHEIbFftK37Kv/0h6BN41MN8D2rfKgGDIoCgSlMP72S+rq/h4j3j ZHqV8WEzGO59YUqwg9BC+Th/qXUcDoD+3/3RjXjcxsWs38lQdF9/dbBgUo5/rl0iGii8 I0DvWYcm23H/nO7SuNw2HD8WxvrSkALXWz4R2bCCaSRPgoIvPJJk24/1ExWTocO5Yiun dcxHRMpfOBaCAz2j2NaN0a33egu9zd4ZpABgRu2ihVMM5WFm4uMalIZSR3wrnpyDRICF FqqA== X-Gm-Message-State: AD7BkJKRwrZGr4X/2r8MQTNtYC3T2rrSnt/o3RjH9CvRidZfV+3kx5nMGMbv2BTqm2ozeg== X-Received: by 10.28.182.194 with SMTP id g185mr18795493wmf.41.1459868172586; Tue, 05 Apr 2016 07:56:12 -0700 (PDT) Received: from Macroninja.cnexlabs.com (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id av3sm35125573wjc.44.2016.04.05.07.56.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Apr 2016 07:56:11 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 1/5] lightnvm: handle submit_io failure Date: Tue, 5 Apr 2016 16:55:27 +0200 Message-Id: <1459868131-15133-2-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1459868131-15133-1-git-send-email-m@bjorling.me> References: <1459868131-15133-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=-7.8 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. Signed-off-by: Matias Bjørling Reviewed-by: Johannes Thumshirn --- 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;