summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2020-06-19 17:14:19 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2020-07-07 21:51:47 -0700
commiteb1353cfa9c1e9415b03dc117f8399969fa02102 (patch)
treef1d0de883a7767ec0831aa3c94b2c88787dff438 /fs/f2fs
parentd078319d069ef437f8f5d840de13f7d939d26c83 (diff)
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/f2fs')
-rw-r--r--fs/f2fs/compress.c6
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;
}