Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [ltt-dev] [PATCH] lttng: Fix list-break bug
@ 2009-01-09  9:48 Gui Jianfeng
  2009-01-09 14:51 ` Mathieu Desnoyers
  0 siblings, 1 reply; 3+ messages in thread
From: Gui Jianfeng @ 2009-01-09  9:48 UTC (permalink / 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, &ltt_traces.head, list)
 		_ltt_trace_stop(trace);
-	tmp = ltt_traces.head;
-	/* empty the original list head */
-	INIT_LIST_HEAD(&ltt_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, &ltt_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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ltt-dev] [PATCH] lttng: Fix list-break bug
  2009-01-09  9:48 [ltt-dev] [PATCH] lttng: Fix list-break bug Gui Jianfeng
@ 2009-01-09 14:51 ` Mathieu Desnoyers
  2009-01-09 15:17   ` Mathieu Desnoyers
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Desnoyers @ 2009-01-09 14:51 UTC (permalink / raw)


* Gui Jianfeng (guijianfeng at cn.fujitsu.com) wrote:
> Hi Mathieu
> When removing ltt-tracer module, OOPS happens.
> Because "tmp = ltt_traces.head;" breaks the list.
> This patch fix it.
> 

Will merge, thanks !

Mathieu

> 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, &ltt_traces.head, list)
>  		_ltt_trace_stop(trace);
> -	tmp = ltt_traces.head;
> -	/* empty the original list head */
> -	INIT_LIST_HEAD(&ltt_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, &ltt_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
> 
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ltt-dev] [PATCH] lttng: Fix list-break bug
  2009-01-09 14:51 ` Mathieu Desnoyers
@ 2009-01-09 15:17   ` Mathieu Desnoyers
  0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2009-01-09 15:17 UTC (permalink / raw)


* Mathieu Desnoyers (compudj at krystal.dyndns.org) wrote:
> * Gui Jianfeng (guijianfeng at cn.fujitsu.com) wrote:
> > Hi Mathieu
> > When removing ltt-tracer module, OOPS happens.
> > Because "tmp = ltt_traces.head;" breaks the list.
> > This patch fix it.
> > 
> 
> Will merge, thanks !
> 

It's now in LTTng 0.72 for 2.6.27.10.

Mathieu

> Mathieu
> 
> > 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, &ltt_traces.head, list)
> >  		_ltt_trace_stop(trace);
> > -	tmp = ltt_traces.head;
> > -	/* empty the original list head */
> > -	INIT_LIST_HEAD(&ltt_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, &ltt_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
> > 
> > 
> > _______________________________________________
> > ltt-dev mailing list
> > ltt-dev at lists.casi.polymtl.ca
> > http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> > 
> 
> -- 
> Mathieu Desnoyers
> OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-09 15:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-09  9:48 [ltt-dev] [PATCH] lttng: Fix list-break bug Gui Jianfeng
2009-01-09 14:51 ` Mathieu Desnoyers
2009-01-09 15:17   ` Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox