Skip to content

Commit eb1353c

Browse files
chaseyuJaegeuk Kim
authored andcommitted
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 <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent d078319 commit eb1353c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/f2fs/compress.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,6 +1322,12 @@ static int f2fs_write_raw_pages(struct compress_ctx *cc,
13221322
congestion_wait(BLK_RW_ASYNC,
13231323
DEFAULT_IO_TIMEOUT);
13241324
lock_page(cc->rpages[i]);
1325+
1326+
if (!PageDirty(cc->rpages[i])) {
1327+
unlock_page(cc->rpages[i]);
1328+
continue;
1329+
}
1330+
13251331
clear_page_dirty_for_io(cc->rpages[i]);
13261332
goto retry_write;
13271333
}

0 commit comments

Comments
 (0)