Messages in this thread Patch in this message | | | From | Sasha Levin <> | Subject | [PATCH AUTOSEL 5.8 05/27] f2fs: fix to check page dirty status before writeback | Date | Wed, 19 Aug 2020 20:00:54 -0400 |
| |
From: Chao Yu <yuchao0@huawei.com>
[ Upstream commit eb1353cfa9c1e9415b03dc117f8399969fa02102 ]
In f2fs_write_raw_pages(), we need to check page dirty status before writeback, because there could be a racer (e.g. reclaimer) helps writebacking the dirty page.
Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> --- fs/f2fs/compress.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 1e02a8c106b0a..ec4ffce4da8bf 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1310,6 +1310,12 @@ static int f2fs_write_raw_pages(struct compress_ctx *cc, congestion_wait(BLK_RW_ASYNC, DEFAULT_IO_TIMEOUT); lock_page(cc->rpages[i]); + + if (!PageDirty(cc->rpages[i])) { + unlock_page(cc->rpages[i]); + continue; + } + clear_page_dirty_for_io(cc->rpages[i]); goto retry_write; } -- 2.25.1
| |