lightnvm: fix bio submission issue

Put bio when submission fails, since we get it
before submission. And return error when backend
device driver doesn't provide a submit_io method,
thus we can end IO properly.

Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Wenwei Tao
2016-01-12 07:49:15 +01:00
committed by Jens Axboe
parent 168309855a
commit 3cd485b1f8
2 changed files with 4 additions and 2 deletions

View File

@@ -345,7 +345,7 @@ static void gennvm_generic_to_addr_mode(struct nvm_dev *dev, struct nvm_rq *rqd)
static int gennvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd)
{
if (!dev->ops->submit_io)
return 0;
return -ENODEV;
/* Convert address space */
gennvm_generic_to_addr_mode(dev, rqd);