qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PULL 3/3] tests: Fix a bug with count variables


From: Stefan Hajnoczi
Subject: [PULL 3/3] tests: Fix a bug with count variables
Date: Fri, 6 Mar 2020 14:23:18 +0000

From: Tianjia Zhang <address@hidden>

The counting code here should use the local variable n_nodes_local.
Otherwise, the variable n_nodes is counting incorrectly, causing the
counting logic of the code to be wrong.

Signed-off-by: Tianjia Zhang <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Link: https://lore.kernel.org/r/address@hidden
Message-Id: <address@hidden>
---
 tests/test-rcu-list.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c
index 1442c0c982..92be51ec50 100644
--- a/tests/test-rcu-list.c
+++ b/tests/test-rcu-list.c
@@ -235,7 +235,7 @@ static void *rcu_q_updater(void *arg)
             j++;
             if (target_el == j) {
                 struct list_element *new_el = g_new(struct list_element, 1);
-                n_nodes += n_nodes_local;
+                n_nodes_local++;
                 TEST_LIST_INSERT_AFTER_RCU(el, new_el, entry);
                 break;
             }
-- 
2.24.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]