From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932396AbcILBjI (ORCPT ); Sun, 11 Sep 2016 21:39:08 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34138 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755177AbcILBjG (ORCPT ); Sun, 11 Sep 2016 21:39:06 -0400 Date: Mon, 12 Sep 2016 09:39:06 +0800 From: Minfei Huang To: agk@redhat.com, snitzer@redhat.com, shli@kernel.org Cc: dm-devel@redhat.com, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dm: Return correct value in retry loop Message-ID: <20160912013906.GA24268@MinfeideMacBook-Pro.local> References: <1473148829-3317-1-git-send-email-mnghuan@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1473148829-3317-1-git-send-email-mnghuan@gmail.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ping. Any comment is appreciate. Thanks Minfei On 09/06/16 at 04:00P, Minfei Huang wrote: > dm_resume will return sliently in retry loop's failure. Assign a correct > return value in the failed loop. > > Remove a useless assignment as well. > > Signed-off-by: Minfei Huang > --- > drivers/md/dm.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/md/dm.c b/drivers/md/dm.c > index fa9b1cb..c935cc8 100644 > --- a/drivers/md/dm.c > +++ b/drivers/md/dm.c > @@ -2249,10 +2249,11 @@ static int __dm_resume(struct mapped_device *md, struct dm_table *map) > > int dm_resume(struct mapped_device *md) > { > - int r = -EINVAL; > + int r; > struct dm_table *map = NULL; > > retry: > + r = -EINVAL; > mutex_lock_nested(&md->suspend_lock, SINGLE_DEPTH_NESTING); > > if (!dm_suspended_md(md)) > @@ -2277,10 +2278,8 @@ retry: > > clear_bit(DMF_SUSPENDED, &md->flags); > > - r = 0; > out: > mutex_unlock(&md->suspend_lock); > - > return r; > } > > -- > 2.7.4 (Apple Git-66) >