Re: [PATCH] irq: tsk->comm is an array

2012-11-06 Thread David Rientjes
On Tue, 6 Nov 2012, Alan Cox wrote:

> From: Alan Cox 
> 
> The array check is useless so remove it.
> 
> Signed-off-by: Alan Cox 

Acked-by: David Rientjes 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] irq: tsk->comm is an array

2012-10-25 Thread David Rientjes
On Thu, 25 Oct 2012, Alan Cox wrote:

> From: Alan Cox 
> 
> More relevantly what about termination and locks ?
> 

The string is always properly terminated with a trailing zero no matter 
how it is written.  For threads other than current, the locking is 
task_lock(task); for current, there are hundreds of places without locking 
and it is generally considered acceptable for a race to print a mangled 
string from a concurrent write to /proc/pid/comm.

> Anyway the array check is useless so remove it.
> 
> Signed-off-by: Alan Cox 
> ---
> 
>  kernel/irq/manage.c |3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index 4c69326..ea39714 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -792,8 +792,9 @@ static void irq_thread_dtor(struct callback_head *unused)
>  
>   action = kthread_data(tsk);
>  
> + /* FIXME: locking */
>   pr_err("exiting task \"%s\" (%d) is an active IRQ thread (irq %d)\n",
> -tsk->comm ? tsk->comm : "", tsk->pid, action->irq);
> +tsk->comm, tsk->pid, action->irq);

Ack without the comment, no locking necessary.

>  
>  
>   desc = irq_to_desc(action->irq);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/