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

lightnvm: re-convert ppa format on I/O failure

In case of a failure when submitting a request, convert the ppa_list
addresses to the target format so that it can interpret ppas for
recovery
Signed-off-by: default avatarJavier González <javier@cnexlabs.com>
Signed-off-by: default avatarMatias Bjørling <matias@cnexlabs.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 8c66ac6a
...@@ -640,6 +640,7 @@ EXPORT_SYMBOL(nvm_max_phys_sects); ...@@ -640,6 +640,7 @@ EXPORT_SYMBOL(nvm_max_phys_sects);
int nvm_submit_io(struct nvm_tgt_dev *tgt_dev, struct nvm_rq *rqd) int nvm_submit_io(struct nvm_tgt_dev *tgt_dev, struct nvm_rq *rqd)
{ {
struct nvm_dev *dev = tgt_dev->parent; struct nvm_dev *dev = tgt_dev->parent;
int ret;
if (!dev->ops->submit_io) if (!dev->ops->submit_io)
return -ENODEV; return -ENODEV;
...@@ -647,7 +648,12 @@ int nvm_submit_io(struct nvm_tgt_dev *tgt_dev, struct nvm_rq *rqd) ...@@ -647,7 +648,12 @@ int nvm_submit_io(struct nvm_tgt_dev *tgt_dev, struct nvm_rq *rqd)
nvm_rq_tgt_to_dev(tgt_dev, rqd); nvm_rq_tgt_to_dev(tgt_dev, rqd);
rqd->dev = tgt_dev; rqd->dev = tgt_dev;
return dev->ops->submit_io(dev, rqd);
/* In case of error, fail with right address format */
ret = dev->ops->submit_io(dev, rqd);
if (ret)
nvm_rq_dev_to_tgt(tgt_dev, rqd);
return ret;
} }
EXPORT_SYMBOL(nvm_submit_io); EXPORT_SYMBOL(nvm_submit_io);
......
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