Comment 34 for bug 1276705

Revision history for this message
PierreF (pierre-fersing) wrote :

If it help, I've done another change (against git hash 786235ee):

diff --git a/kernel/kthread.c b/kernel/kthread.c
index b5ae3ee..25a4780 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -298,7 +298,7 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
                 * that thread.
                 */
                if (xchg(&create->done, NULL))
- return ERR_PTR(-ENOMEM);
+ return ERR_PTR(-42);
                /*
                 * kthreadd (or new kernel thread) will call complete()
                 * shortly.

So, depending on error (-12 / -ENOMEM or -42) we could know which return triggered the bug.

Result is:

[ 37.607981] scsi4: error handler thread failed to spawn, error = -42

To make sure the race condition do not affect which error is returned, I've booted 5 times that kernel. Each time I get error = -42.