Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Commit

Permalink
Call kthread_create() correctly with fixed arguments.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #347
  • Loading branch information
dweeezil authored and behlendorf committed Apr 11, 2014
1 parent ed650de commit 3ceb71e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion module/spl/spl-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3ceb71e

Please sign in to comment.