Commit 281a8273 authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman

staging/lustre/libcfs: Do not call kthread_run in wrong state

kthread_run might sleep during an allocation, and so
it's considered unsafe to call with a state that's not
RUNNABLE.
Move the state setting to after kthread_run call.
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 025fd3c2
...@@ -362,12 +362,12 @@ void libcfs_debug_dumplog(void) ...@@ -362,12 +362,12 @@ void libcfs_debug_dumplog(void)
* get to schedule() * get to schedule()
*/ */
init_waitqueue_entry(&wait, current); init_waitqueue_entry(&wait, current);
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&debug_ctlwq, &wait); add_wait_queue(&debug_ctlwq, &wait);
dumper = kthread_run(libcfs_debug_dumplog_thread, dumper = kthread_run(libcfs_debug_dumplog_thread,
(void *)(long)current_pid(), (void *)(long)current_pid(),
"libcfs_debug_dumper"); "libcfs_debug_dumper");
set_current_state(TASK_INTERRUPTIBLE);
if (IS_ERR(dumper)) if (IS_ERR(dumper))
pr_err("LustreError: cannot start log dump thread: %ld\n", pr_err("LustreError: cannot start log dump thread: %ld\n",
PTR_ERR(dumper)); PTR_ERR(dumper));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment