diff options
author | Chao Yu <yuchao0@huawei.com> | 2020-06-19 12:14:19 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2020-07-08 07:51:47 +0300 |
commit | eb1353cfa9c1e9415b03dc117f8399969fa02102 (patch) | |
tree | f1d0de883a7767ec0831aa3c94b2c88787dff438 /fs | |
parent | d078319d069ef437f8f5d840de13f7d939d26c83 (diff) | |
download | linux-eb1353cfa9c1e9415b03dc117f8399969fa02102.tar.xz |
f2fs: fix to check page dirty status before writeback
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/compress.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index cde6868c77bb..dcc9f807a647 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1322,6 +1322,12 @@ retry_write: 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; } |