aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2010-05-18 08:31:45 -0400
committerJens Axboe <jens.axboe@oracle.com>2010-05-21 14:00:25 -0400
commitf9eadbbd424c083b8005c7b738f644611b9ef489 (patch)
treeedc73e0fa56de566af7672f6f80579ec317d373f
parent7c8a3554c683f512dbcee26faedb42e4c05f12fa (diff)
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: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--fs/fs-writeback.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 76f546d56a64..437a7431b4ea 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -978,8 +978,13 @@ int bdi_writeback_task(struct bdi_writeback *wb)
978 if (dirty_writeback_interval) { 978 if (dirty_writeback_interval) {
979 wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10); 979 wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
980 schedule_timeout_interruptible(wait_jiffies); 980 schedule_timeout_interruptible(wait_jiffies);
981 } else 981 } else {
982 schedule(); 982 set_current_state(TASK_INTERRUPTIBLE);
983 if (list_empty_careful(&wb->bdi->work_list) &&
984 !kthread_should_stop())
985 schedule();
986 __set_current_state(TASK_RUNNING);
987 }
983 988
984 try_to_freeze(); 989 try_to_freeze();
985 } 990 }