FROMLIST: f2fs: let FI_OPU_WRITE override FADVISE_COLD_BIT

Cold files may be fragmented due to SSR, defragment is needed as
sequential reads are dominant scenarios of these files. FI_OPU_WRITE
should override FADVISE_COLD_BIT to avoid defragment fails.

Bug: 246903585

Signed-off-by: Weichao Guo <guoweichao@oppo.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Weichao Guo <guoweichao@oppo.corp-partner.google.com>
Link: https://lore.kernel.org/all/YxlTQ3H+PPKcvpyc@google.com/T/
Change-Id: I52ab86a15ec275772c5356bfc985803bbdde4408
This commit is contained in:
Weichao Guo 2022-09-07 10:38:48 +08:00 committed by Treehugger Robot
parent 06b301069f
commit 2fc96f32ee

View File

@ -2524,7 +2524,7 @@ bool f2fs_should_update_inplace(struct inode *inode, struct f2fs_io_info *fio)
return true;
/* if this is cold file, we should overwrite to avoid fragmentation */
if (file_is_cold(inode))
if (file_is_cold(inode) && !is_inode_flag_set(inode, FI_OPU_WRITE))
return true;
return check_inplace_update_policy(inode, fio);