[ltt-dev] [PATCH] lttng-modules v0.19-stable: setup_trace_write: Fix recursive locking

Mathieu Desnoyers compudj at krystal.dyndns.org
Fri Nov 25 17:00:32 EST 2011


* Niskanen, Juha (juha_niskanen at mentor.com) wrote:
> lttng-modules: ltt_trace_destroy calls ltt_lock_traces internally so this non-recursive
> mutex must be first unlocked when executing error handling code.

merged, thanks!

Mathieu

> 
> Signed-off-by: Juha Niskanen <juha_niskanen at mentor.com>
> ---
>  ltt-trace-control.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/ltt-trace-control.c b/ltt-trace-control.c
> index 9d6d239..12a3f19 100644
> --- a/ltt-trace-control.c
> +++ b/ltt-trace-control.c
> @@ -734,6 +734,8 @@ ssize_t setup_trace_write(struct file *file, const char __user *user_buf,
>  	if (IS_ERR_VALUE(err)) {
>  		printk(KERN_ERR "setup_trace_write: "
>  		       "_create_trace_control_dir failed: %d\n", err);
> +		ltt_unlock_traces();
> +		ltt_trace_destroy(trace_name);
>  		goto err_create_trace_control_dir;
>  	}
>  
> @@ -744,10 +746,9 @@ ssize_t setup_trace_write(struct file *file, const char __user *user_buf,
>  	free_page((unsigned long)trace_name);
>  	return count;
>  
> -err_create_trace_control_dir:
> -	ltt_trace_destroy(trace_name);
>  err_setup_trace:
>  	ltt_unlock_traces();
> +err_create_trace_control_dir:
>  	mutex_unlock(&control_lock);
>  err_get_tracename:
>  err_copy_from_user:
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




More information about the lttng-dev mailing list