All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm: Return correct value in retry loop
@ 2016-09-06  8:00 Minfei Huang
  2016-09-12  1:39 ` Minfei Huang
  0 siblings, 1 reply; 3+ messages in thread
From: Minfei Huang @ 2016-09-06  8:00 UTC (permalink / raw)
  To: agk, snitzer, shli; +Cc: dm-devel, linux-raid, linux-kernel, Minfei Huang

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 <mnghuan@gmail.com>
---
 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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dm: Return correct value in retry loop
  2016-09-06  8:00 [PATCH] dm: Return correct value in retry loop Minfei Huang
@ 2016-09-12  1:39 ` Minfei Huang
  2016-09-12 15:01   ` Mike Snitzer
  0 siblings, 1 reply; 3+ messages in thread
From: Minfei Huang @ 2016-09-12  1:39 UTC (permalink / raw)
  To: agk, snitzer, shli; +Cc: dm-devel, linux-raid, linux-kernel

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 <mnghuan@gmail.com>
> ---
>  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)
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: dm: Return correct value in retry loop
  2016-09-12  1:39 ` Minfei Huang
@ 2016-09-12 15:01   ` Mike Snitzer
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Snitzer @ 2016-09-12 15:01 UTC (permalink / raw)
  To: Minfei Huang; +Cc: agk, shli, linux-raid, dm-devel, linux-kernel

Thanks for the patch, I've picked it up as a stable@ fix for either
4.8-rc7 or when the 4.9 merge windw opens (I'm leaning toward the latter
since this issue has been around since 3.19 was released and there
aren't any known problems/reports related to this oversight).

Please see:
https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-4.8&id=7735f936a13d79bbaead1723e4532e65d4c4cf01

On Sun, Sep 11 2016 at  9:39pm -0400,
Minfei Huang <mnghuan@gmail.com> wrote:

> 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 <mnghuan@gmail.com>
> > ---
> >  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)
> > 
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-12 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-06  8:00 [PATCH] dm: Return correct value in retry loop Minfei Huang
2016-09-12  1:39 ` Minfei Huang
2016-09-12 15:01   ` Mike Snitzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.