Skip to contentSkip to conversation

irq: tsk->comm is an array

PATCH In review Alan Cox 2 participants 2 messages Oct 25, 2012 IRQ

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 irq: tsk->comm is an array

From: Alan Cox <[email protected]>

More relevantly what about termination and locks ?

Anyway the array check is useless so remove it.

---

 kernel/irq/manage.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/manage.c +2 -1
index 4c69326..ea39714 100644
@@ -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);
#1 lore raw
Quoted 4 lines · Alan Cox

From: Alan Cox <[email protected]>

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.

Quoted 13 lines

Anyway the array check is useless so remove it.

---

 kernel/irq/manage.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/manage.c +0 -0
index 4c69326..ea39714 100644

kernel/irq/manage.c static void irq_thread_dtor(struct callback_head *unused) · line 797

Quoted 7 lines
kernel/irq/manage.c +2 -1
@@ -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.

Quoted 3 lines
kernel/irq/manage.c +0 -0
 	desc = irq_to_desc(action->irq);