From 7b9a87094a636fc7aab37225c099ad28b3afe9e4 Mon Sep 17 00:00:00 2001 From: Yunlei He Date: Tue, 23 Feb 2016 12:07:56 +0800 Subject: [PATCH] UPSTREAM: f2fs: avoid hungtask problem caused by losing wake_up The D state of wait_on_all_pages_writeback should be waken by function f2fs_write_end_io when all writeback pages have been succesfully written to device. It's possible that wake_up comes between get_pages and io_schedule. Maybe in this case it will lost wake_up and still in D state even if all pages have been write back to device, and finally, the whole system will be into the hungtask state. if (!get_pages(sbi, F2FS_WRITEBACK)) break; <--------- wake_up io_schedule(); Change-Id: I8a60393c91343d75b7d48df2ca19d1735d69cc51 Signed-off-by: Yunlei He Signed-off-by: Biao He Signed-off-by: Jaegeuk Kim (cherry picked from commit 0ff21646f2a5c6ff77acc51eb3df4235af39be46) Signed-off-by: Cliff Chen --- fs/f2fs/checkpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index f661d80474be..341fb0e6784c 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -914,7 +914,7 @@ static void wait_on_all_pages_writeback(struct f2fs_sb_info *sbi) if (!get_pages(sbi, F2FS_WRITEBACK)) break; - io_schedule(); + io_schedule_timeout(5*HZ); } finish_wait(&sbi->cp_wait, &wait); } -- 2.34.1