summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzangyangyang1 <zangyangyang1@xiaomi.com>2025-01-13 11:05:18 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2025-01-13 18:49:38 +0000
commitc84c2424932d18cf3888adfe9bd16f95dc5d9fd4 (patch)
tree8c4444e76724ba4d9ebf44478d889329114d293e
parente53c568f4603e997426712146dce0bc194c1db12 (diff)
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>
-rw-r--r--fs/f2fs/compress.c1
-rw-r--r--fs/f2fs/data.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index c5e42eec8ac9..985690d81a82 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -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,
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 35b9455fb899..e9582e06403b 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -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);