Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932881AbcDEPEK (ORCPT ); Tue, 5 Apr 2016 11:04:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:54854 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758061AbcDEPEI (ORCPT ); Tue, 5 Apr 2016 11:04:08 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 05 Apr 2016 17:04:05 +0200 From: Johannes Thumshirn To: =?UTF-8?Q?Matias_Bj=C3=B8rling?= Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block-owner@vger.kernel.org Subject: Re: [PATCH 1/5] lightnvm: handle submit_io failure In-Reply-To: <1459868131-15133-2-git-send-email-m@bjorling.me> References: <1459868131-15133-1-git-send-email-m@bjorling.me> <1459868131-15133-2-git-send-email-m@bjorling.me> Message-ID: <1718345855a28710c601781ed0e2f4eb@suse.de> User-Agent: Roundcube Webmail Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1002 Lines: 30 On 2016-04-05 16:55, Matias Bjørling wrote: > 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. > > Signed-off-by: Matias Bjørling > --- > drivers/lightnvm/core.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c > index 0dc9a80..c2ef53a 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; Looks good, Reviewed-by: Johannes Thumshirn