From patchwork Fri Jun 1 13:04:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10443381 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 EE5FF602BC for ; Fri, 1 Jun 2018 13:08:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E227828B30 for ; Fri, 1 Jun 2018 13:08:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6EB128B49; Fri, 1 Jun 2018 13:08:24 +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=unavailable 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 90E0928B30 for ; Fri, 1 Jun 2018 13:08:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752006AbeFANIW (ORCPT ); Fri, 1 Jun 2018 09:08:22 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:37020 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752003AbeFANEw (ORCPT ); Fri, 1 Jun 2018 09:04:52 -0400 Received: by mail-lf0-f67.google.com with SMTP id r2-v6so14721968lff.4 for ; Fri, 01 Jun 2018 06:04:51 -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=kMZi+ma7lWPCBKgNWxG+Dvzw1TJiSW+yZn3QBoecBCCnyGZmBIhqPo3sQhqLmRrGOD QlP/Mrl5x8uqvpHd2omsSsas/cajgZ08OfZqBFpftXTdFu0nuGx6VkwluJinAfIdfQIo MGpB4d6XkLIn69Dq3tDR80eNVkE3d1QXlq4qxzPjneAbR2vYjiYVYJU7uh7cY0cC9rI1 cqBGWK3d8sLmWVdH/97T0cxHoUZAv+C9FrD+PUtz6pzfErYVT6La29Wg/YtyIGv1VQdm gGOAGBHYEpWVEL8ymSZesP2M733W9fbPFp4MZameUGVYHB25wD/C03pk14Oy0yNxYCi2 V55A== 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=r4t5UV2L7C/Plif/H6+whFnao8UeScW0QTc4A5urnpsMsZAenPD9jfUjRg+mCZoCak oTiiewIb73b9xLWnKMDOyz4yKeEJfItjod2ODPue8uwG+Ibgru5w6olGcP2QflnKSS0r Z2ndLQUVInoNm/hY4AS9BvWDWg+XiMHzGby+dyijvflzDTYKdEfKPeSRVKnA61o18nH3 1sl2yJVckOaDismQpYsHAwQbkevchk0M4UZMQ90F0sX8i+fWW2bnIoUtH5LlXo1TsHm7 LYw/Zv6GV+z82gQkHVqVvoWuRiTV1ElS2/VIgDtPMF06Bmh21DqHI5W99JpgU6C9G01/ b4Jw== X-Gm-Message-State: ALKqPweSjOeDoBnnbsXfK5YVcyd/ELdgFG/w8DS6hbArWHBndEez8mb/ UVrJ8z5QyA4L7Zd5hzRWrYntCA== X-Google-Smtp-Source: ADUXVKJ+riBudW8vzZlh3jI8gCXnl1Ud+P8vZ/IiGUZqQ0iuo5S68fVZclLhOhak6U9U/Kzce5ijxw== X-Received: by 2002:a19:1204:: with SMTP id h4-v6mr6573827lfi.12.1527858291162; Fri, 01 Jun 2018 06:04:51 -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 g5-v6sm303161lje.21.2018.06.01.06.04.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jun 2018 06:04:50 -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, javier@cnexlabs.com, igor.j.konopko@intel.com, marcin.dziegielewski@intel.com, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 06/18] lightnvm: pblk: return NVM_ error on failed submission Date: Fri, 1 Jun 2018 15:04:20 +0200 Message-Id: <20180601130432.30866-7-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180601130432.30866-1-mb@lightnvm.io> References: <20180601130432.30866-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); }