Commit b6730dd4 authored by Javier González's avatar Javier González Committed by Jens Axboe

lightnvm: pblk: return NVM_ error on failed submission

Return a meaningful error when the sanity vector I/O check fails.
Signed-off-by: default avatarJavier González <javier@cnexlabs.com>
Signed-off-by: default avatarMatias Bjørling <mb@lightnvm.io>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e37d0798
...@@ -467,16 +467,13 @@ int pblk_submit_io(struct pblk *pblk, struct nvm_rq *rqd) ...@@ -467,16 +467,13 @@ int pblk_submit_io(struct pblk *pblk, struct nvm_rq *rqd)
{ {
struct nvm_tgt_dev *dev = pblk->dev; struct nvm_tgt_dev *dev = pblk->dev;
#ifdef CONFIG_NVM_DEBUG atomic_inc(&pblk->inflight_io);
int ret;
ret = pblk_check_io(pblk, rqd); #ifdef CONFIG_NVM_DEBUG
if (ret) if (pblk_check_io(pblk, rqd))
return ret; return NVM_IO_ERR;
#endif #endif
atomic_inc(&pblk->inflight_io);
return nvm_submit_io(dev, rqd); return nvm_submit_io(dev, rqd);
} }
...@@ -484,16 +481,13 @@ int pblk_submit_io_sync(struct pblk *pblk, struct nvm_rq *rqd) ...@@ -484,16 +481,13 @@ int pblk_submit_io_sync(struct pblk *pblk, struct nvm_rq *rqd)
{ {
struct nvm_tgt_dev *dev = pblk->dev; struct nvm_tgt_dev *dev = pblk->dev;
#ifdef CONFIG_NVM_DEBUG atomic_inc(&pblk->inflight_io);
int ret;
ret = pblk_check_io(pblk, rqd); #ifdef CONFIG_NVM_DEBUG
if (ret) if (pblk_check_io(pblk, rqd))
return ret; return NVM_IO_ERR;
#endif #endif
atomic_inc(&pblk->inflight_io);
return nvm_submit_io_sync(dev, rqd); return nvm_submit_io_sync(dev, rqd);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment