From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Laurent Vivier <lvivier@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Thomas Huth <thuth@redhat.com>,
Tianjia Zhang <tianjia.zhang@linux.alibaba.com>,
qemu-block@nongnu.org, Alexander Bulekov <alxndr@bu.edu>,
Bandan Das <bsd@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [PULL 3/3] tests: Fix a bug with count variables
Date: Fri, 6 Mar 2020 14:23:18 +0000 [thread overview]
Message-ID: <20200306142318.1435372-4-stefanha@redhat.com> (raw)
In-Reply-To: <20200306142318.1435372-1-stefanha@redhat.com>
From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
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 | 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
next prev parent reply other threads:[~2020-03-06 14:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 14:23 [PULL 0/3] Block patches Stefan Hajnoczi
2020-03-06 14:23 ` [PULL 1/3] fuzz: fix style/typos in linker-script comments Stefan Hajnoczi
2020-03-06 14:23 ` [PULL 2/3] qtest: fix fuzzer-related 80-char limit violations Stefan Hajnoczi
2020-03-06 14:23 ` Stefan Hajnoczi [this message]
2020-03-06 17:02 ` [PULL 0/3] Block patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200306142318.1435372-4-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=alxndr@bu.edu \
--cc=bsd@redhat.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
--cc=tianjia.zhang@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).