UPSTREAM: f2fs: avoid hungtask problem caused by losing wake_up
authorYunlei He <heyunlei@huawei.com>
Tue, 23 Feb 2016 04:07:56 +0000 (12:07 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 8 Nov 2016 02:13:01 +0000 (10:13 +0800)
commit7b9a87094a636fc7aab37225c099ad28b3afe9e4
tree8550e0bf7de2e3d9c77ddcc5df93ddb5e1ac8208
parent95c5fe39782c57a43e5ef9177d856f5b5f252cb6
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 <heyunlei@huawei.com>
Signed-off-by: Biao He <hebiao6@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 0ff21646f2a5c6ff77acc51eb3df4235af39be46)
Signed-off-by: Cliff Chen <cliff.chen@rock-chips.com>
fs/f2fs/checkpoint.c