OSDN Git Service
(root)
/
qmiga
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3fc92f8
)
tests: Fix a bug with count variables
author
Tianjia Zhang
<tianjia.zhang@linux.alibaba.com>
Fri, 7 Feb 2020 11:54:33 +0000
(19:54 +0800)
committer
Stefan Hajnoczi
<stefanha@redhat.com>
Fri, 6 Mar 2020 10:35:15 +0000
(10:35 +0000)
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 <tianjia.zhang@linux.alibaba.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Link:
https://lore.kernel.org/r/20200207115433.118254-1-tianjia.zhang@linux.alibaba.com
Message-Id: <
20200207115433
.118254-1-tianjia.zhang@linux.alibaba.com>
tests/test-rcu-list.c
patch
|
blob
|
history
diff --git
a/tests/test-rcu-list.c
b/tests/test-rcu-list.c
index
1442c0c
..
92be51e
100644
(file)
--- 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;
}