]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
f2fs: pass correct iostat type for single node writes
authorWenjie Qi <qwjhust@gmail.com>
Wed, 20 May 2026 12:07:05 +0000 (20:07 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 22 Jun 2026 19:52:35 +0000 (19:52 +0000)
f2fs_write_single_node_folio() takes an io_type argument, but still
passes FS_GC_NODE_IO to __write_node_folio() unconditionally.

This was harmless while the helper was only used by
f2fs_move_node_folio(), whose caller passes FS_GC_NODE_IO. However,
commit fe9b8b30b971 ("f2fs: fix inline data not being written to disk
in writeback path") made f2fs_inline_data_fiemap() call the helper with
FS_NODE_IO for FIEMAP_FLAG_SYNC.

Honor the caller supplied io_type so inline-data FIEMAP sync writeback is
accounted as normal node IO instead of GC node IO, while the GC path
continues to pass FS_GC_NODE_IO explicitly.

Cc: stable@kernel.org
Fixes: fe9b8b30b971 ("f2fs: fix inline data not being written to disk in writeback path")
Signed-off-by: Wenjie Qi <qiwenjie@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c

index a464d5ee11244f4b81b288ea8d8721e62f50780b..cd5a394f6111432c6cb3dfa6ede3437c70f7ca92 100644 (file)
@@ -1885,7 +1885,7 @@ int f2fs_write_single_node_folio(struct folio *node_folio, int sync_mode,
        }
 
        if (!__write_node_folio(node_folio, false, false, NULL,
-                               &wbc, false, FS_GC_NODE_IO, NULL))
+                               &wbc, false, io_type, NULL))
                err = -EAGAIN;
        goto release_folio;
 out_folio: