mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
b40a2b0037
The page cache of the atomic file keeps new data pages which will be
stored in the COW file. It can also keep old data pages when GCing the
atomic file. In this case, new data can be overwritten by old data if a
GC thread sets the old data page as dirty after new data page was
evicted.
Also, since all writes to the atomic file are redirected to COW inodes,
GC for the atomic file is not working well as below.
f2fs_gc(gc_type=FG_GC)
- select A as a victim segment
do_garbage_collect
- iget atomic file's inode for block B
move_data_page
f2fs_do_write_data_page
- use dn of cow inode
- set fio->old_blkaddr from cow inode
- seg_freed is 0 since block B is still valid
- goto gc_more and A is selected as victim again
To solve the problem, let's separate GC writes and updates in the atomic
file by using the meta inode for GC writes.
Fixes:
|
||
---|---|---|
.. | ||
acl.c | ||
acl.h | ||
checkpoint.c | ||
compress.c | ||
data.c | ||
debug.c | ||
dir.c | ||
extent_cache.c | ||
f2fs.h | ||
file.c | ||
gc.c | ||
gc.h | ||
hash.c | ||
inline.c | ||
inode.c | ||
iostat.c | ||
iostat.h | ||
Kconfig | ||
Makefile | ||
namei.c | ||
node.c | ||
node.h | ||
recovery.c | ||
segment.c | ||
segment.h | ||
shrinker.c | ||
super.c | ||
sysfs.c | ||
verity.c | ||
xattr.c | ||
xattr.h |