Commit ff1581f7 authored by Srivatsa Vaddagiri's avatar Srivatsa Vaddagiri Committed by Linus Torvalds

[PATCH] Fix obvious stupid race in do_stop

We don't set the task state to TASK_INTERRUPTIBLE _before_ checking for
kthread_should_stop in do_stop.
parent 360f2ed0
......@@ -149,10 +149,12 @@ static int do_stop(void *_smdata)
complete(&smdata->done);
/* Wait for kthread_stop */
__set_current_state(TASK_INTERRUPTIBLE);
while (!kthread_should_stop()) {
__set_current_state(TASK_INTERRUPTIBLE);
schedule();
__set_current_state(TASK_INTERRUPTIBLE);
}
__set_current_state(TASK_RUNNING);
return ret;
}
......
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