提交 12aebf3e 编写于 作者: M Maxim Levitsky 提交者: David Woodhouse

mtd: blktrans: fix a race vs kthread_stop

There is small race window that could make kthread_stop hang forever.
I found that while hacking the IR subsystem.
Signed-off-by: NMaxim Levitsky <maximlevisky@gmail.com>
Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 480792b7
......@@ -133,6 +133,10 @@ static int mtd_blktrans_thread(void *arg)
if (!req && !(req = blk_fetch_request(rq))) {
set_current_state(TASK_INTERRUPTIBLE);
if (kthread_should_stop())
set_current_state(TASK_RUNNING);
spin_unlock_irq(rq->queue_lock);
schedule();
spin_lock_irq(rq->queue_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册