From: Tim Chase Date: Fri, 11 Apr 2014 13:55:10 +0000 (-0500) Subject: Call kthread_create() correctly with fixed arguments. X-Git-Tag: zfs-0.8.0-rc1~152^2~238 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ceb71e8966e5f1895885eeaaa9354ffd940b490;p=zfs 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 --- 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);