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.
If it help, I've done another change (against git hash 786235ee):
diff --git a/kernel/kthread.c b/kernel/kthread.c create_ on_node( int (*threadfn)(void *data), create- >done, NULL))
index b5ae3ee..25a4780 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -298,7 +298,7 @@ struct task_struct *kthread_
* that thread.
*/
if (xchg(&
- 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.