Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
f2fs: fix to check page dirty status before writeback
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
chaseyu authored and radcolor committed Dec 3, 2020
1 parent 17e1bfe commit 49f558e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/f2fs/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,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;
}
Expand Down

0 comments on commit 49f558e

Please sign in to comment.