Received: by 10.192.165.148 with SMTP id m20csp3556075imm; Mon, 30 Apr 2018 02:14:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpQckt6KbQMLTGX0WPJvpf30gpmo43otWOr2/d2l4csSyBJn9o/vU6r3ybc1rvtBdFcyaEJ X-Received: by 2002:a65:5308:: with SMTP id m8-v6mr9423360pgq.28.1525079649352; Mon, 30 Apr 2018 02:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525079649; cv=none; d=google.com; s=arc-20160816; b=Qi7rPQ5p1qx6VMJuh6tc+1HldE0U/4HOIVMqLlxJm/dTfAB+j+gYpgkn1FKqyPyv7t l8PMlLYuCDFxv6de2zvBVHsSEG7ASjm+VVpnPKbNT1AQksFTuTWej//5R1dq9hQ9ccoq FHUrocg7aWgE5SYCxzQ/U2XxsEn71wqYz/29CsSztdR0aomxBMTdKviLQi+DGqb2uZ+D 0grtL1dbcOOhVUHLsh0CsmASL5uUYsGgKaVHiUbgZecFZKfzfb5pvgawtL11GnEUrqXV 9NCyjXxjFEm2IgAqxoh4YMK/cvjK+0g5OE8LiI5Z/sCRxbvHvWa82R3+3iF+W0S+E0sJ GdMg== 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=ekcS9805oXbGIo0+54pUZey1+kVmnvZnRrsNUeNg0QCxwkDOzV+rqBj97jEFZNsfKT YoZFPMIqz81uIKUBpY3u/X5r+YcSLEvbJuTpAW9G0Ob2TgnfZKqp9DJylHJQxs/uh45i RUCTwstTyD02q6XKAMh5gufE24tIMbrNAm3FR4wsdIgdJHxxv7U/A4vjEgViRbkGkQA6 jO3IycPo7JTo+unMskBOcJECCuztnGA472K9deqEYU2Tbrk6gCkzscV34oM6bTn7qs3E mdDeaRwU0/m14MPhYhnT1ak1fmX1xQ8WmzZG5q/cTrwwcB2AK9ui2P2TUVkvBe35Yr5G 4IPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@javigon-com.20150623.gappssmtp.com header.s=20150623 header.b=fSV6UTHS; 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 e18-v6si5917423pgt.3.2018.04.30.02.13.55; Mon, 30 Apr 2018 02:14:09 -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=fSV6UTHS; 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 S1753558AbeD3JMU (ORCPT + 99 others); Mon, 30 Apr 2018 05:12:20 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:55775 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753723AbeD3JKW (ORCPT ); Mon, 30 Apr 2018 05:10:22 -0400 Received: by mail-wm0-f66.google.com with SMTP id a8so11899753wmg.5 for ; Mon, 30 Apr 2018 02:10:22 -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=fSV6UTHSE0+CTbeT15Cr/Uod+7PO/iVgSoxRn/sG2AMDeCe79pSwrZF9ehvjtHmFRP JL94grh4nDJ4UwAolloy6dhY/7rg/35ZB9Fsn+Ttk4Se9Q4JwsrMTZysYWNfqsLApMjM dXPEmJEMSb40l3FcUXC9M9/+8qsVXQEAEMiYUQd3eQ4nqcUM0vpOvoJfrhh5ftMnF2v/ KbSLtHgRurnDPwObalJ2Y5bKdC1ihsFKlpjZpnmzE8f3kMzThzJXmyJyZruwoKGCVvlS nLPcW31u9JhT53v2PiE+GYvO+AeMxSRw7N7FHu/siGRXtW+UUJIJOj4l7RCJycm8pPcs cv2A== 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=hB854Yi1ygtLSBZdNcCZRHiLdKRWO1h5DMHXNKbmVyztpnT1VvIw5aWdHmIf4yNmtp 2mmOmLwZzbNX5H4gw2tcGxaC2UEBUuet8S3sZqX3yQ/uW1OH4lAZ0gdfZrx2KI50Q3Ei LJyIDq71UB0NsLTlFjFjYVrSF7vGTFpxF84u/TF87oWgCclAnQMCnEkQolBhv6asR1zI vYhpL95gols62fkNJ7J9744O6Hnz8nW6RZZZEUxrWRrXVWgpJxO9VMm4zj4G0mEDWegE LceokbFQ5BH9EihhMp1HSsazU6BzjXXa9SnOCqAz0KIS6iBIZuppm0tmR+tW/5EG55bt 9Uow== X-Gm-Message-State: ALQs6tDXPgYJT51lQG3QT8dmFCB7W2T+Cp1daDJs6WVJLI1dsmZFISty fdy4mdZUSw3bHE2PTkNw47Cu9g2P X-Received: by 2002:a50:b654:: with SMTP id c20-v6mr15957617ede.190.1525079421790; Mon, 30 Apr 2018 02:10:21 -0700 (PDT) Received: from uhalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id b56-v6sm2108638edd.85.2018.04.30.02.10.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Apr 2018 02:10:21 -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, 30 Apr 2018 11:10:04 +0200 Message-Id: <1525079409-6588-7-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525079409-6588-1-git-send-email-javier@cnexlabs.com> References: <1525079409-6588-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