All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ocfs2: remove useless if statement
@ 2015-02-17  7:13 ` Daeseok Youn
  0 siblings, 0 replies; 5+ messages in thread
From: Daeseok Youn @ 2015-02-17  7:13 UTC (permalink / raw)
  To: mfasheh, akpm; +Cc: jlbec, ocfs2-devel, linux-kernel

The Local variable "i" in for loop is always less then
O2CB_MAP_STABILIZE_COUNT.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 fs/ocfs2/stack_o2cb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c
index 1724d43..813d726 100644
--- a/fs/ocfs2/stack_o2cb.c
+++ b/fs/ocfs2/stack_o2cb.c
@@ -295,8 +295,8 @@ static int o2cb_cluster_check(void)
 		set_bit(node_num, netmap);
 		if (!memcmp(hbmap, netmap, sizeof(hbmap)))
 			return 0;
-		if (i < O2CB_MAP_STABILIZE_COUNT)
-			msleep(1000);
+
+		msleep(1000);
 	}
 
 	printk(KERN_ERR "o2cb: This node could not connect to nodes:");
-- 
1.7.1


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

* [Ocfs2-devel] [PATCH 1/2] ocfs2: remove useless if statement
@ 2015-02-17  7:13 ` Daeseok Youn
  0 siblings, 0 replies; 5+ messages in thread
From: Daeseok Youn @ 2015-02-17  7:13 UTC (permalink / raw)
  To: mfasheh, akpm; +Cc: jlbec, ocfs2-devel, linux-kernel

The Local variable "i" in for loop is always less then
O2CB_MAP_STABILIZE_COUNT.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 fs/ocfs2/stack_o2cb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c
index 1724d43..813d726 100644
--- a/fs/ocfs2/stack_o2cb.c
+++ b/fs/ocfs2/stack_o2cb.c
@@ -295,8 +295,8 @@ static int o2cb_cluster_check(void)
 		set_bit(node_num, netmap);
 		if (!memcmp(hbmap, netmap, sizeof(hbmap)))
 			return 0;
-		if (i < O2CB_MAP_STABILIZE_COUNT)
-			msleep(1000);
+
+		msleep(1000);
 	}
 
 	printk(KERN_ERR "o2cb: This node could not connect to nodes:");
-- 
1.7.1

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

* Re: [PATCH 1/2] ocfs2: remove useless if statement
  2015-02-17  7:13 ` [Ocfs2-devel] " Daeseok Youn
@ 2015-02-17 23:30   ` Andrew Morton
  -1 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2015-02-17 23:30 UTC (permalink / raw)
  To: Daeseok Youn; +Cc: mfasheh, jlbec, ocfs2-devel, linux-kernel

On Tue, 17 Feb 2015 16:13:50 +0900 Daeseok Youn <daeseok.youn@gmail.com> wrote:

> The Local variable "i" in for loop is always less then
> O2CB_MAP_STABILIZE_COUNT.
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
>  fs/ocfs2/stack_o2cb.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c
> index 1724d43..813d726 100644
> --- a/fs/ocfs2/stack_o2cb.c
> +++ b/fs/ocfs2/stack_o2cb.c
> @@ -295,8 +295,8 @@ static int o2cb_cluster_check(void)
>  		set_bit(node_num, netmap);
>  		if (!memcmp(hbmap, netmap, sizeof(hbmap)))
>  			return 0;
> -		if (i < O2CB_MAP_STABILIZE_COUNT)
> -			msleep(1000);
> +
> +		msleep(1000);
>  	}

I assume the code was intended to do

	if (i < O2CB_MAP_STABILIZE_COUNT - 1)
		msleep(1000);

to avoid a pointless 1-second delay when the operation times out.

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

* [Ocfs2-devel] [PATCH 1/2] ocfs2: remove useless if statement
@ 2015-02-17 23:30   ` Andrew Morton
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2015-02-17 23:30 UTC (permalink / raw)
  To: Daeseok Youn; +Cc: mfasheh, jlbec, ocfs2-devel, linux-kernel

On Tue, 17 Feb 2015 16:13:50 +0900 Daeseok Youn <daeseok.youn@gmail.com> wrote:

> The Local variable "i" in for loop is always less then
> O2CB_MAP_STABILIZE_COUNT.
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
>  fs/ocfs2/stack_o2cb.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c
> index 1724d43..813d726 100644
> --- a/fs/ocfs2/stack_o2cb.c
> +++ b/fs/ocfs2/stack_o2cb.c
> @@ -295,8 +295,8 @@ static int o2cb_cluster_check(void)
>  		set_bit(node_num, netmap);
>  		if (!memcmp(hbmap, netmap, sizeof(hbmap)))
>  			return 0;
> -		if (i < O2CB_MAP_STABILIZE_COUNT)
> -			msleep(1000);
> +
> +		msleep(1000);
>  	}

I assume the code was intended to do

	if (i < O2CB_MAP_STABILIZE_COUNT - 1)
		msleep(1000);

to avoid a pointless 1-second delay when the operation times out.

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

* [Ocfs2-devel] [PATCH 1/2] ocfs2: remove useless if statement
  2015-02-17 23:30   ` [Ocfs2-devel] " Andrew Morton
  (?)
@ 2015-02-19  3:02   ` DaeSeok Youn
  -1 siblings, 0 replies; 5+ messages in thread
From: DaeSeok Youn @ 2015-02-19  3:02 UTC (permalink / raw)
  To: ocfs2-devel

Hi,

2015. 2. 18. ?? 8:30? "Andrew Morton" <akpm@linux-foundation.org>?? ??:
>
> On Tue, 17 Feb 2015 16:13:50 +0900 Daeseok Youn <daeseok.youn@gmail.com>
wrote:
>
> > The Local variable "i" in for loop is always less then
> > O2CB_MAP_STABILIZE_COUNT.
> >
> > Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> > ---
> >  fs/ocfs2/stack_o2cb.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c
> > index 1724d43..813d726 100644
> > --- a/fs/ocfs2/stack_o2cb.c
> > +++ b/fs/ocfs2/stack_o2cb.c
> > @@ -295,8 +295,8 @@ static int o2cb_cluster_check(void)
> >               set_bit(node_num, netmap);
> >               if (!memcmp(hbmap, netmap, sizeof(hbmap)))
> >                       return 0;
> > -             if (i < O2CB_MAP_STABILIZE_COUNT)
> > -                     msleep(1000);
> > +
> > +             msleep(1000);
> >       }
>
> I assume the code was intended to do
>
>         if (i < O2CB_MAP_STABILIZE_COUNT - 1)
>                 msleep(1000);
>
> to avoid a pointless 1-second delay when the operation times out.

Ok. I will send this patch after makes it as your comment.

Thanks.
Regards,
Daeseok Youn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20150219/a11d2644/attachment.html 

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

end of thread, other threads:[~2015-02-19  3:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-17  7:13 [PATCH 1/2] ocfs2: remove useless if statement Daeseok Youn
2015-02-17  7:13 ` [Ocfs2-devel] " Daeseok Youn
2015-02-17 23:30 ` Andrew Morton
2015-02-17 23:30   ` [Ocfs2-devel] " Andrew Morton
2015-02-19  3:02   ` DaeSeok Youn

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.