From: guijianfeng@cn.fujitsu.com (Gui Jianfeng)
Subject: [ltt-dev] [PATCH] lttng: Fix list-break bug
Date: Fri, 09 Jan 2009 17:48:18 +0800 [thread overview]
Message-ID: <49671D62.6080903@cn.fujitsu.com> (raw)
Hi Mathieu
When removing ltt-tracer module, OOPS happens.
Because "tmp = ltt_traces.head;" breaks the list.
This patch fix it.
Signed-off-by: Gui Jianfeng <guijianfeng at cn.fujitsu.com>
---
ltt/ltt-tracer.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/ltt/ltt-tracer.c b/ltt/ltt-tracer.c
index af14135..ceb0c04 100644
--- a/ltt/ltt-tracer.c
+++ b/ltt/ltt-tracer.c
@@ -1159,20 +1159,16 @@ static void __exit ltt_exit(void)
{
struct ltt_trace_struct *trace;
struct list_head *pos, *n;
- struct list_head tmp;
ltt_lock_traces();
/* Stop each trace, currently being read by RCU read-side */
list_for_each_entry_rcu(trace, <t_traces.head, list)
_ltt_trace_stop(trace);
- tmp = ltt_traces.head;
- /* empty the original list head */
- INIT_LIST_HEAD(<t_traces.head);
/* Wait for quiescent state. Readers have preemption disabled. */
synchronize_sched();
/* Safe iteration is now permitted. It does not have to be RCU-safe
* because no readers are left. */
- list_for_each_safe(pos, n, &tmp) {
+ list_for_each_safe(pos, n, <t_traces.head) {
trace = container_of(pos, struct ltt_trace_struct, list);
/* _ltt_trace_destroy does a synchronize_sched() */
_ltt_trace_destroy(trace);
--
1.5.4.rc3
--
Regards
Gui Jianfeng
next reply other threads:[~2009-01-09 9:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-09 9:48 Gui Jianfeng [this message]
2009-01-09 14:51 ` Mathieu Desnoyers
2009-01-09 15:17 ` Mathieu Desnoyers
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=49671D62.6080903@cn.fujitsu.com \
--to=guijianfeng@cn.fujitsu.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