On 01/06, zangyangyang wrote:
> From: zangyangyang1 <zangyangya...@xiaomi.com>
> 
> When f2fs_write_single_data_page fails, f2fs_write_cache_pages
> will use the last 'submitted' value incorrectly, which will cause
> 'nwritten' and 'wbc->nr_to_write' calculation errors
> 
> Signed-off-by: zangyangyang1 <zangyangya...@xiaomi.com>
> ---
> v3: No logical changes, just format patch
> v2: Initialize "submitted" in f2fs_write_single_data_page()
> ---
>  fs/f2fs/data.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 94f7b084f601..f772fbc7f331 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -2816,6 +2816,9 @@ int f2fs_write_single_data_page(struct folio *folio, 
> int *submitted,
>  
>       trace_f2fs_writepage(folio, DATA);
>  
> +     if (submitted)
> +             *submitted = 0;

I don't think this is correct, as callers should handle it.

> +
>       /* we should bypass data pages to proceed the kworker jobs */
>       if (unlikely(f2fs_cp_error(sbi))) {
>               mapping_set_error(folio->mapping, -EIO);
> -- 
> 2.43.2


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

Reply via email to