Received: by 10.192.165.156 with SMTP id m28csp466345imm; Mon, 16 Apr 2018 03:28:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/CPHT6QFR5UPF2iURIIy/Z86ECZocnIEcYy3e/hXgaN2eM40aY9PqG1f/WprgBNoPXa3+v X-Received: by 2002:a17:902:590d:: with SMTP id o13-v6mr9858002pli.130.1523874514730; Mon, 16 Apr 2018 03:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523874514; cv=none; d=google.com; s=arc-20160816; b=omTSpTgjsY+BVo4/9cc+kMpcS0GpCmZrUucoG7Hjv/YZdQ7yeSS8X99zV0mhQig9SU QZVFx1bwi8HEmfK7007AZAZn+Bs1OlKMxUQtF5RzteLill67HAhwkp/l2B49jF983ggC Ba7f/mieO7aQBj+4hk0U29iei9i/uRu1+DF/GG+YNCfEiHtyc27YW8YK1XGW+bBnoGt3 wSRRqv8n2fI5IEDxX1jqZtWEZe2vbtalrZXpcnlDENVqaVjlCWeXXhBtm7kdPx4z4dNg tXNkLxByb/0NfKjC5lG5SIRBVNCf3LcHVP3Nz6HejNxlOETBnMuEy5/uC4p4MS8C2bck FN8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=2So0/T7YU86Mz6m93qlNqJE7ovLM2DzIfTMRubfGVeA=; b=AOco+TNZITGlxNbrXs8bNWtNXZy+/QRxFuBgUZ3l6JioICM/vUEW01qrtRaGKCY5YA TqzNYp/kyc2Epuh/0ZSRiH5wFCb879AVe3O+PhpYQ6nCYc0XfDtToyiONpFAcBXWPEo4 A23gRtiFRKxD65+OJ9GkzqEzvbJsum4ACBftTiz5jPtIqVhJsLOFaIlxhwtbufzbu7R0 j6KDljW62hk2ULJAtkUyakW9UoGeaNUiSuPNH0pgYLYAi3xsAkyf5gMlH/+Uol0NBuAD pTbqA8liWBK4IPoHDu3ysd53vCWaGBVuTaOCMuVzHE3Ee65W8M+HUAKYs5K+MsaAT3vB g9+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@javigon-com.20150623.gappssmtp.com header.s=20150623 header.b=r/CPAVMC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12-v6si11970960pll.184.2018.04.16.03.28.20; Mon, 16 Apr 2018 03:28:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@javigon-com.20150623.gappssmtp.com header.s=20150623 header.b=r/CPAVMC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754218AbeDPKZu (ORCPT + 99 others); Mon, 16 Apr 2018 06:25:50 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:36949 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753984AbeDPKZr (ORCPT ); Mon, 16 Apr 2018 06:25:47 -0400 Received: by mail-wr0-f196.google.com with SMTP id l49so24435663wrl.4 for ; Mon, 16 Apr 2018 03:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=javigon-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2So0/T7YU86Mz6m93qlNqJE7ovLM2DzIfTMRubfGVeA=; b=r/CPAVMCH1sAN1uqRpBXqLsF+5clqQvI3sHu1ofv+OGpjAXF1w1fQyy5Nc7S/9sQdv MjzuLmUjtYQdDFKe23Qp4ZX7dqV621SQq/RpEQJ/SCIcH8k4dTOD1wkUM4XdTDe938DU VdJcZG02RkGyc+JhJ/ubQTNEEDLzLitSOGGqbQzp7GyvlZsov9TBnDb981yeIFXiMQLj c27mEIhHX6+lH14rs7IH6EuKyTCVPY8y4DVGdIFS20DyP4j+WoO/F0ehbHBxVA9zm+3a 9vTmje6jyCtpgv0+aJ9XzGc1fiJsy7iAD0e3pk+hbBs55ryghOeBYpIo+9P0M5A/edsX KXtQ== 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=2So0/T7YU86Mz6m93qlNqJE7ovLM2DzIfTMRubfGVeA=; b=Lwclydg2OXs6d6D7BfSU3jndhEzYQjaAtS3ftuCbLkgHBLe2p/7aJf/bRWftcHY7u+ dwErVdqRmHpJJ+SjvUdoKd8swwWGvj48+aVGcrHerixchE3g7UOYEWO7vu4wvm7GiafQ AcyczK4bFeLHUogsxu4nnAYdPEZV7HxfgzQ+r6zaVWXRo8T9Xce/gIDc1Wr1kJ3ZVShT Og9ELqtbIFNtSLJxepE60Yznx0lr5VWbIbUqZxknOkuLBJGqwefaCxe17Z/qwVQHmHt6 KqqKKHEaRjj/X1q5SBxImT2lzoUxvBOZGEXsJ1WPyfw/bBSZX1rv59Ui3F3x0+TvN7k9 JRgA== X-Gm-Message-State: ALQs6tB6MZ+zacqiI1bcXmAIhQbO4y7HooXAx1tK47VVk6Xg54JkM5Xi +1SsMB8WOtf9q9v2LAdzPLPLsA== X-Received: by 10.80.141.131 with SMTP id r3mr9121643edh.236.1523874346070; Mon, 16 Apr 2018 03:25:46 -0700 (PDT) Received: from uhalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id q11sm4250074edj.2.2018.04.16.03.25.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Apr 2018 03:25:45 -0700 (PDT) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH 06/11] lightnvm: pblk: return NVM_ error on failed submission Date: Mon, 16 Apr 2018 12:25:27 +0200 Message-Id: <1523874332-6272-7-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523874332-6272-1-git-send-email-javier@cnexlabs.com> References: <1523874332-6272-1-git-send-email-javier@cnexlabs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return a meaningful error when the sanity vector I/O check fails. Signed-off-by: Javier González --- 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 128101f9e606..6bc0c7f61aac 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); } -- 2.7.4