Call kthread_create() correctly with fixed arguments.

The kernel's kthread_create() function is defined as "..." and there is
no va_list variant at the moment.  The task name is pre-formatted into
a local buffer and passed to kthread_create() with fixed arguments.

Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #347
This commit is contained in:
Tim Chase 2014-04-11 08:55:10 -05:00 committed by Brian Behlendorf
parent ed650dee76
commit 3ceb71e896
1 changed files with 4 additions and 1 deletions

View File

@ -148,10 +148,13 @@ spl_kthread_create(int (*func)(void *), void *data, const char namefmt[], ...)
{
struct task_struct *tsk;
va_list args;
char name[TASK_COMM_LEN];
va_start(args, namefmt);
vsnprintf(name, sizeof(name), namefmt, args);
va_end(args);
do {
tsk = kthread_create(func, data, namefmt, args);
tsk = kthread_create(func, data, "%s", name);
if (IS_ERR(tsk)) {
if (signal_pending(current)) {
clear_thread_flag(TIF_SIGPENDING);