[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1525079409-6588-7-git-send-email-javier@cnexlabs.com>
Date: Mon, 30 Apr 2018 11:10:04 +0200
From: "Javier González" <javier@...igon.com>
To: mb@...htnvm.io
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Javier González <javier@...xlabs.com>
Subject: [PATCH 06/11] lightnvm: pblk: return NVM_ error on failed submission
Return a meaningful error when the sanity vector I/O check fails.
Signed-off-by: Javier González <javier@...xlabs.com>
---
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
Powered by blists - more mailing lists