From patchwork Mon May 28 08:58:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10430177 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BB88F602CC for ; Mon, 28 May 2018 09:05:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACBAB28BE1 for ; Mon, 28 May 2018 09:05:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A19C928BE5; Mon, 28 May 2018 09:05:41 +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 45FCB28BE1 for ; Mon, 28 May 2018 09:05:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754166AbeE1JFk (ORCPT ); Mon, 28 May 2018 05:05:40 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35425 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754176AbeE1I66 (ORCPT ); Mon, 28 May 2018 04:58:58 -0400 Received: by mail-wm0-f66.google.com with SMTP id o78-v6so30148172wmg.0 for ; Mon, 28 May 2018 01:58:57 -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=/tcWzyKQ8jfTdo4Pf21s1nL4rl+mbqMPqtMnnfkhIOk=; b=mEuIpyAxBStXuzz+rk9N9hlpFiUsfSEGJxGQ56dfcjGyIhgU4k663jWkj/zx2gZykH g/ZdDJfUeHYIpfJeOvWbGfQ9EXjeP38RUYAm9tTBLcNwApLUpXxnk718lTuLF0WA2rCP 2nM+dbrWXEWJbkXU3ny/qYcj+FPPfrQckcaohDCeXkZrZPdl2Ksw4Yf/e31O9yS+5Ibj QiMbGGF5mTpzl9T0TC0yBsRdu2wbyWdBh65eUfHVtHI5gxL4bGadG+JntyEa98fRnUR8 Mkhgq5q06O4djf4DuvBYhbJw52AHNnk3NAHA92nDY8jhTrsA8FjrwiDtKBAeQTPFfSW7 MrpA== 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=/tcWzyKQ8jfTdo4Pf21s1nL4rl+mbqMPqtMnnfkhIOk=; b=DDzsSLmwX2OCK9lnSZuZtRaliMS2AHJcqIrB4V0vA0KdaWr7JJcy/y1V3E7Ixs9/BT gar0RT0hgcqgGam+p1xcnODFmfT3SncjiLnIzb7ePm0TRxni1tNnawV7pApq9I8DRNV3 9hljYtAdHVwaVuPtmuXr2TiBueDtuTTj87J90nFHezMYA/oM+nc50hX/r47NfuBqUAeu sXmq7oXRZ6nVCHg0D9ge2MLpUa+K82X4prj2doDOHlkvgpbP/IyEkfAOfFVjCb+CWLal ZeVxN4uXiQJ2hgwetswORdsD9uJpzy1Xp12xlPu+8uKrOt5BmN2lG/qa3mLcVrZ0m5IB l+qQ== X-Gm-Message-State: ALKqPwdT2/LXW0j/z56rc/ma0RYLCBtR5RbOHtZelZAaAtudPiz6iBHN yC9nWHZespKxM8TLI4vXR9V9xg== X-Google-Smtp-Source: ADUXVKIf4azHoQMC48wKH6XjZK9JAdgFhRmCDSFNqxX552jbV5JJZ3i1tUVQWeyYoNgrnMnPfQuh9w== X-Received: by 2002:a2e:934f:: with SMTP id m15-v6mr7733745ljh.39.1527497937148; Mon, 28 May 2018 01:58:57 -0700 (PDT) Received: from Macroninja.cnexlabs.com (95-166-82-66-cable.dk.customer.tdc.net. [95.166.82.66]) by smtp.gmail.com with ESMTPSA id u2-v6sm5777848lji.4.2018.05.28.01.58.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 May 2018 01:58:56 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 06/20] lightnvm: pblk: return NVM_ error on failed submission Date: Mon, 28 May 2018 10:58:27 +0200 Message-Id: <20180528085841.26684-7-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180528085841.26684-1-mb@lightnvm.io> References: <20180528085841.26684-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: Javier González Return a meaningful error when the sanity vector I/O check fails. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-core.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c index 2cad918434a7..0d4078805ecc 100644 --- a/drivers/lightnvm/pblk-core.c +++ b/drivers/lightnvm/pblk-core.c @@ -467,16 +467,13 @@ int pblk_submit_io(struct pblk *pblk, struct nvm_rq *rqd) { struct nvm_tgt_dev *dev = pblk->dev; + atomic_inc(&pblk->inflight_io); + #ifdef CONFIG_NVM_DEBUG - int ret; - - ret = pblk_check_io(pblk, rqd); - if (ret) - return ret; + if (pblk_check_io(pblk, rqd)) + return NVM_IO_ERR; #endif - atomic_inc(&pblk->inflight_io); - return nvm_submit_io(dev, rqd); } @@ -484,16 +481,13 @@ int pblk_submit_io_sync(struct pblk *pblk, struct nvm_rq *rqd) { struct nvm_tgt_dev *dev = pblk->dev; + atomic_inc(&pblk->inflight_io); + #ifdef CONFIG_NVM_DEBUG - int ret; - - ret = pblk_check_io(pblk, rqd); - if (ret) - return ret; + if (pblk_check_io(pblk, rqd)) + return NVM_IO_ERR; #endif - atomic_inc(&pblk->inflight_io); - return nvm_submit_io_sync(dev, rqd); }