• Sunmin Jeong's avatar
    f2fs: use meta inode for GC of COW file · f18d0076
    Sunmin Jeong authored
    In case of the COW file, new updates and GC writes are already
    separated to page caches of the atomic file and COW file. As some cases
    that use the meta inode for GC, there are some race issues between a
    foreground thread and GC thread.
    
    To handle them, we need to take care when to invalidate and wait
    writeback of GC pages in COW files as the case of using the meta inode.
    Also, a pointer from the COW inode to the original inode is required to
    check the state of original pages.
    
    For the former, we can solve the problem by using the meta inode for GC
    of COW files. Then let's get a page from the original inode in
    move_data_block when GCing the COW file to avoid race condition.
    
    Fixes: 3db1de0e ("f2fs: change the current atomic write way")
    Cc: stable@vger.kernel.org #v5.19+
    Reviewed-by: default avatarSungjong Seo <sj1557.seo@samsung.com>
    Reviewed-by: default avatarYeongjin Gil <youngjin.gil@samsung.com>
    Signed-off-by: default avatarSunmin Jeong <s_min.jeong@samsung.com>
    Reviewed-by: default avatarChao Yu <chao@kernel.org>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    f18d0076
f2fs.h 152 KB