Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

f2fs: remove non-uptodate folio from the page cache in move_data_block

During data movement, move_data_block acquires file folio without
triggering a file read. Such folio are typically not uptodate, they need
to be removed from the page cache after gc complete. This patch marks
folio with the PG_dropbehind flag and uses folio_end_dropbehind to
remove folio from the page cache.

Signed-off-by: Yunlei He <heyunlei@xiaomi.com>
Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Yongpeng Yang and committed by
Jaegeuk Kim
9609dd70 db1a8a78

+5 -1
+5 -1
fs/f2fs/gc.c
··· 1453 1453 put_out: 1454 1454 f2fs_put_dnode(&dn); 1455 1455 out: 1456 - f2fs_folio_put(folio, true); 1456 + if (!folio_test_uptodate(folio)) 1457 + __folio_set_dropbehind(folio); 1458 + folio_unlock(folio); 1459 + folio_end_dropbehind(folio); 1460 + folio_put(folio); 1457 1461 return err; 1458 1462 } 1459 1463