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)
{
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);
}
......
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