]> git.proxmox.com Git - mirror_spl.git/commitdiff
Call kthread_create() correctly with fixed arguments.
authorTim Chase <tim@chase2k.com>
Fri, 11 Apr 2014 13:55:10 +0000 (08:55 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 11 Apr 2014 16:41:40 +0000 (09:41 -0700)
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

module/spl/spl-thread.c

index a74b9d9accbfcd97ddf44696676981f19a282aa4..5c851405177eea7779efdcb41b794501334a7510 100644 (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);