Skip to content

Commit

Permalink
lightnvm: re-convert ppa format on I/O failure
Browse files Browse the repository at this point in the history
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: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Javier González authored and Jens Axboe committed Jun 26, 2017
1 parent 8c66ac6 commit 3e505af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/lightnvm/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,14 +640,20 @@ EXPORT_SYMBOL(nvm_max_phys_sects);
int nvm_submit_io(struct nvm_tgt_dev *tgt_dev, struct nvm_rq *rqd)
{
struct nvm_dev *dev = tgt_dev->parent;
int ret;

if (!dev->ops->submit_io)
return -ENODEV;

nvm_rq_tgt_to_dev(tgt_dev, rqd);

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);

Expand Down

0 comments on commit 3e505af

Please sign in to comment.