From 3ceb71e8966e5f1895885eeaaa9354ffd940b490 Mon Sep 17 00:00:00 2001 From: Tim Chase Date: Fri, 11 Apr 2014 08:55:10 -0500 Subject: [PATCH] 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 Signed-off-by: Tim Chase Signed-off-by: Brian Behlendorf Closes #347 --- module/spl/spl-thread.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/spl/spl-thread.c b/module/spl/spl-thread.c index a74b9d9ac..5c8514051 100644 --- a/module/spl/spl-thread.c +++ b/module/spl/spl-thread.c @@ -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); -- 2.40.0