tests: Fix a bug with count variables
PATCH 1/1 tests: Fix a bug with count variables
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.
--- tests/test-rcu-list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/test-rcu-list.c +1 -1
@@ -219,7 +219,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 ; }
Signature · 1 line
2.17.1
Quoted 8 lines · Tianjia Zhang
The counting code here should use the local variable
n_nodes_local. Otherwise, the variablen_nodesis counting incorrectly, causing the counting logic of the code to be wrong.Signed-off-by Tianjia Zhang <[email protected]>--- tests/test-rcu-list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 15 lines · Tianjia Zhang
Quoted 5 lines · Stefan Hajnoczi
Quoted 4 lines · Tianjia Zhang
The counting code here should use the local variable
n_nodes_local. Otherwise, the variablen_nodesis counting incorrectly, causing the counting logic of the code to be wrong.Quoted 7 lines
Quoted 4 lines
Signed-off-by Tianjia Zhang <[email protected]>---
tests/test-rcu-list.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Stefan Hajnoczi <[email protected]>
Quoted 6 lines
Hi,
I see that this patch has not entered the mainline. It has been more than 20 days. Dont forget it.
Thanks,
Tianjia
Thanks and Best,
Tianjia
Stefan Hajnoczi
AppliedQuoted 8 lines · Tianjia Zhang
The counting code here should use the local variable
n_nodes_local. Otherwise, the variablen_nodesis counting incorrectly, causing the counting logic of the code to be wrong.Signed-off-by Tianjia Zhang <[email protected]>--- tests/test-rcu-list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Sorry for the delay! Normally this would not go through my tree, but the tests/ maintainer is away on leave so I'll merge the patch.
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
Quoted 10 lines · Stefan Hajnoczi
Quoted 8 lines · Tianjia Zhang
The counting code here should use the local variable
n_nodes_local. Otherwise, the variablen_nodesis counting incorrectly, causing the counting logic of the code to be wrong.Signed-off-by Tianjia Zhang <[email protected]>--- tests/test-rcu-list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines
Sorry for the delay! Normally this would not go through my tree, but the tests/ maintainer is away on leave so I'll merge the patch.
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/blockStefan
Thanks and Best,
Tianjia