diff options
author | Oleg Drokin <green@linuxhacker.ru> | 2016-06-20 16:55:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 14:28:39 -0700 |
commit | 281a8273f6d8664b14c9164ff6d659049c43b3f0 (patch) | |
tree | 9d333085c4044bd27f14c86dbf538dff125ddccc /drivers/staging/lustre/lnet | |
parent | 025fd3c20bfb4e84972f174c7246f86d693f6544 (diff) |
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: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lnet')
-rw-r--r-- | drivers/staging/lustre/lnet/libcfs/debug.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lnet/libcfs/debug.c b/drivers/staging/lustre/lnet/libcfs/debug.c index 75a2a42f7d0c..42b15a769183 100644 --- a/drivers/staging/lustre/lnet/libcfs/debug.c +++ b/drivers/staging/lustre/lnet/libcfs/debug.c @@ -362,12 +362,12 @@ void libcfs_debug_dumplog(void) * get to schedule() */ init_waitqueue_entry(&wait, current); - set_current_state(TASK_INTERRUPTIBLE); add_wait_queue(&debug_ctlwq, &wait); dumper = kthread_run(libcfs_debug_dumplog_thread, (void *)(long)current_pid(), "libcfs_debug_dumper"); + set_current_state(TASK_INTERRUPTIBLE); if (IS_ERR(dumper)) pr_err("LustreError: cannot start log dump thread: %ld\n", PTR_ERR(dumper)); |