Skip to contentSkip to conversation

ocfs2: remove useless if statement

PATCH In review Daeseok Youn 2 participants 3 messages Feb 17, 2015 – Feb 19, 2015 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ocfs2: remove useless if statement

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

---
 fs/ocfs2/stack_o2cb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/ocfs2/stack_o2cb.c +2 -2
index 1724d43..813d726 100644
@@ -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:");
Signature · 1 line
1.7.1
#1 lore raw
Quoted 13 lines · On Tue, 17 Feb 2015 16:13:50 +0900 Daeseok Youn <[email protected]> wrote:

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

---
 fs/ocfs2/stack_o2cb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/ocfs2/stack_o2cb.c +0 -0
index 1724d43..813d726 100644

fs/ocfs2/stack_o2cb.c static int o2cb_cluster_check(void) · line 300

Quoted 8 lines
fs/ocfs2/stack_o2cb.c +2 -2
@@ -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.

#2 lore raw

PATCH 1/2 ocfs2: remove useless if statement

Hi,

2015. 2. 18. ?? 8:30? "Andrew Morton" <[email protected]>?? ??:

Quoted 2 lines

On Tue, 17 Feb 2015 16:13:50 +0900 Daeseok Youn <[email protected]>

Quoted 25 lines · wrote:
Quoted 14 lines

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

---
 fs/ocfs2/stack_o2cb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/ocfs2/stack_o2cb.c +0 -0
index 1724d43..813d726 100644

fs/ocfs2/stack_o2cb.c static int o2cb_cluster_check(void) · line 300

Quoted 8 lines
fs/ocfs2/stack_o2cb.c +2 -2
@@ -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

Quoted 4 lines

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