All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH v3] f2fs: fix using wrong 'submitted' value in f2fs_write_cache_pages
@ 2025-01-06  3:36 zangyangyang
  2025-01-08 18:29 ` Jaegeuk Kim via Linux-f2fs-devel
  0 siblings, 1 reply; 5+ messages in thread
From: zangyangyang @ 2025-01-06  3:36 UTC (permalink / raw)
  To: chao; +Cc: jaegeuk, zangyangyang1, linux-f2fs-devel

From: zangyangyang1 <zangyangyang1@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 <zangyangyang1@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;
+
 	/* 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-09 12:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-06  3:36 [f2fs-dev] [PATCH v3] f2fs: fix using wrong 'submitted' value in f2fs_write_cache_pages zangyangyang
2025-01-08 18:29 ` Jaegeuk Kim via Linux-f2fs-devel
2025-01-09  2:23   ` 臧阳阳
2025-01-09 10:19     ` Chao Yu via Linux-f2fs-devel
2025-01-09 12:46       ` YangYang Zang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.