Commit f9eadbbd authored by Jens Axboe's avatar Jens Axboe

writeback: bdi_writeback_task() must set task state before calling schedule()

Calling schedule without setting the task state to non-running will
return immediately, so ensure that we set it properly and check our
sleep conditions after doing so.

This is a fixup for commit 69b62d01.
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 7c8a3554
...@@ -978,8 +978,13 @@ int bdi_writeback_task(struct bdi_writeback *wb) ...@@ -978,8 +978,13 @@ int bdi_writeback_task(struct bdi_writeback *wb)
if (dirty_writeback_interval) { if (dirty_writeback_interval) {
wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10); wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
schedule_timeout_interruptible(wait_jiffies); schedule_timeout_interruptible(wait_jiffies);
} else } else {
schedule(); set_current_state(TASK_INTERRUPTIBLE);
if (list_empty_careful(&wb->bdi->work_list) &&
!kthread_should_stop())
schedule();
__set_current_state(TASK_RUNNING);
}
try_to_freeze(); try_to_freeze();
} }
......
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