f2fs: fix using wrong 'submitted' value in f2fs_write_cache_pages

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 <zangyangyang1@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
zangyangyang1 2025-01-13 11:05:18 +08:00 committed by Jaegeuk Kim
parent e53c568f46
commit c84c242493
2 changed files with 2 additions and 0 deletions

View file

@ -1551,6 +1551,7 @@ continue_unlock:
if (!clear_page_dirty_for_io(cc->rpages[i]))
goto continue_unlock;
submitted = 0;
ret = f2fs_write_single_data_page(page_folio(cc->rpages[i]),
&submitted,
NULL, NULL, wbc, io_type,

View file

@ -3154,6 +3154,7 @@ continue_unlock:
continue;
}
#endif
submitted = 0;
ret = f2fs_write_single_data_page(folio,
&submitted, &bio, &last_block,
wbc, io_type, 0, true);