aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm
diff options
context:
space:
mode:
authorMatias Bjørling <m@bjorling.me>2016-05-06 14:02:55 -0400
committerJens Axboe <axboe@fb.com>2016-05-06 14:51:10 -0400
commitecfb40c6aa5691257054eac81bc8bdfd5442e8e5 (patch)
treea3746289014c46fbb787bd2c397a68cbe651ca45 /drivers/lightnvm
parent57aac2f1be4a0711b7f24f7d367e8672ebaa3844 (diff)
lightnvm: handle submit_io failure
The device ->submit_io() callback might fail to submit I/O to device. In that case, the nvm_submit_ppa function should not wait for completion. Instead return the ->submit_io() error. Reviewed by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm')
-rw-r--r--drivers/lightnvm/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 0dc9a80adb94..c2ef53a0d7f8 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -351,6 +351,11 @@ int nvm_submit_ppa(struct nvm_dev *dev, struct ppa_addr *ppa, int nr_ppas,
351 nvm_generic_to_addr_mode(dev, &rqd); 351 nvm_generic_to_addr_mode(dev, &rqd);
352 352
353 ret = dev->ops->submit_io(dev, &rqd); 353 ret = dev->ops->submit_io(dev, &rqd);
354 if (ret) {
355 nvm_free_rqd_ppalist(dev, &rqd);
356 bio_put(bio);
357 return ret;
358 }
354 359
355 /* Prevent hang_check timer from firing at us during very long I/O */ 360 /* Prevent hang_check timer from firing at us during very long I/O */
356 hang_check = sysctl_hung_task_timeout_secs; 361 hang_check = sysctl_hung_task_timeout_secs;