From ecfb40c6aa5691257054eac81bc8bdfd5442e8e5 Mon Sep 17 00:00:00 2001 From: Matias Bjørling Date: Fri, 6 May 2016 20:02:55 +0200 Subject: lightnvm: handle submit_io failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe --- drivers/lightnvm/core.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/lightnvm/core.c') 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, nvm_generic_to_addr_mode(dev, &rqd); ret = dev->ops->submit_io(dev, &rqd); + if (ret) { + nvm_free_rqd_ppalist(dev, &rqd); + bio_put(bio); + return ret; + } /* Prevent hang_check timer from firing at us during very long I/O */ hang_check = sysctl_hung_task_timeout_secs; -- cgit v1.2.3-59-g8ed1b