public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irq: tsk->comm is an array
@ 2012-10-25 15:01 Alan Cox
  2012-10-25 20:04 ` David Rientjes
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2012-10-25 15:01 UTC (permalink / raw)
  To: linux-kernel

From: Alan Cox <alan@linux.intel.com>

More relevantly what about termination and locks ?

Anyway the array check is useless so remove it.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 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);
 
 
 	desc = irq_to_desc(action->irq);


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

* Re: [PATCH] irq: tsk->comm is an array
  2012-10-25 15:01 [PATCH] irq: tsk->comm is an array Alan Cox
@ 2012-10-25 20:04 ` David Rientjes
  0 siblings, 0 replies; 4+ messages in thread
From: David Rientjes @ 2012-10-25 20:04 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

On Thu, 25 Oct 2012, Alan Cox wrote:

> From: Alan Cox <alan@linux.intel.com>
> 
> 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 <alan@linux.intel.com>
> ---
> 
>  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);

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

* [PATCH] irq: tsk->comm is an array
@ 2012-11-06 14:28 Alan Cox
  2012-11-06 19:26 ` David Rientjes
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2012-11-06 14:28 UTC (permalink / raw)
  To: linux-kernel

From: Alan Cox <alan@linux.intel.com>

The array check is useless so remove it.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 kernel/irq/manage.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 4c69326..ba3853a 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -793,7 +793,7 @@ static void irq_thread_dtor(struct callback_head *unused)
 	action = kthread_data(tsk);
 
 	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);
 
 
 	desc = irq_to_desc(action->irq);


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

* Re: [PATCH] irq: tsk->comm is an array
  2012-11-06 14:28 Alan Cox
@ 2012-11-06 19:26 ` David Rientjes
  0 siblings, 0 replies; 4+ messages in thread
From: David Rientjes @ 2012-11-06 19:26 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

On Tue, 6 Nov 2012, Alan Cox wrote:

> From: Alan Cox <alan@linux.intel.com>
> 
> The array check is useless so remove it.
> 
> Signed-off-by: Alan Cox <alan@linux.intel.com>

Acked-by: David Rientjes <rientjes@google.com>

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

end of thread, other threads:[~2012-11-06 19:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-25 15:01 [PATCH] irq: tsk->comm is an array Alan Cox
2012-10-25 20:04 ` David Rientjes
  -- strict thread matches above, loose matches on Subject: below --
2012-11-06 14:28 Alan Cox
2012-11-06 19:26 ` David Rientjes

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