On 09/07, Weichao Guo wrote:
> 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.
> 
> Signed-off-by: Weichao Guo <guoweic...@oppo.com>
> Signed-off-by: Chao Yu <c...@kernel.org>
> ---
>  fs/f2fs/data.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index aa3ccdd..97b75f0 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -2543,7 +2543,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(FI_OPU_WRITE))

                                   Fixed build error by adding inode above.

>               return true;
>  
>       return check_inplace_update_policy(inode, fio);
> -- 
> 2.7.4


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to