]> git.baikalelectronics.ru Git - kernel.git/commitdiff
lightnvm: pblk: return NVM_ error on failed submission
authorJavier González <javier@javigon.com>
Fri, 1 Jun 2018 13:04:20 +0000 (15:04 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 1 Jun 2018 13:43:53 +0000 (07:43 -0600)
Return a meaningful error when the sanity vector I/O check fails.

Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-core.c

index f34ce522348e77b31b5b6ccdd7973c3886f36ea0..9a70cfe18934f66ae5c9f837a3d8afc39f6272f6 100644 (file)
@@ -467,16 +467,13 @@ int pblk_submit_io(struct pblk *pblk, struct nvm_rq *rqd)
 {
        struct nvm_tgt_dev *dev = pblk->dev;
 
-#ifdef CONFIG_NVM_DEBUG
-       int ret;
+       atomic_inc(&pblk->inflight_io);
 
-       ret = pblk_check_io(pblk, rqd);
-       if (ret)
-               return ret;
+#ifdef CONFIG_NVM_DEBUG
+       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;
 
-#ifdef CONFIG_NVM_DEBUG
-       int ret;
+       atomic_inc(&pblk->inflight_io);
 
-       ret = pblk_check_io(pblk, rqd);
-       if (ret)
-               return ret;
+#ifdef CONFIG_NVM_DEBUG
+       if (pblk_check_io(pblk, rqd))
+               return NVM_IO_ERR;
 #endif
 
-       atomic_inc(&pblk->inflight_io);
-
        return nvm_submit_io_sync(dev, rqd);
 }