[PATCH v2] f2fs: fix to add gc count stat in f2fs_gc_range

Zhiguo Niu posted 1 patch 1 month, 2 weeks ago
There is a newer version of this series
fs/f2fs/gc.c | 1 +
1 file changed, 1 insertion(+)
[PATCH v2] f2fs: fix to add gc count stat in f2fs_gc_range
Posted by Zhiguo Niu 1 month, 2 weeks ago
It missed the stat count in f2fs_gc_range.

Cc: stable@kernel.org
Fixes: 2f0209f579d1 ("f2fs: separate f2fs_gc_range() to use GC for a range")
Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
---
V2: add Cc and Fixes tags
---
 fs/f2fs/gc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 6afd57f..58b291d 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -2096,6 +2096,7 @@ int f2fs_gc_range(struct f2fs_sb_info *sbi,
 	if (unlikely(f2fs_cp_error(sbi)))
 		return -EIO;
 
+	stat_inc_gc_call_count(sbi, FOREGROUND);
 	for (segno = start_seg; segno <= end_seg; segno += SEGS_PER_SEC(sbi)) {
 		struct gc_inode_list gc_list = {
 			.ilist = LIST_HEAD_INIT(gc_list.ilist),
-- 
1.9.1
Re: [PATCH v2] f2fs: fix to add gc count stat in f2fs_gc_range
Posted by Chao Yu 1 month, 1 week ago
On 12/19/2025 12:03 PM, Zhiguo Niu wrote:
> It missed the stat count in f2fs_gc_range.
> 
> Cc: stable@kernel.org
> Fixes: 2f0209f579d1 ("f2fs: separate f2fs_gc_range() to use GC for a range")

Fixes: 9bf1dcbdfdc88 ("f2fs: fix to account gc stats correctly") ?

> Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
> ---
> V2: add Cc and Fixes tags
> ---
>   fs/f2fs/gc.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 6afd57f..58b291d 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -2096,6 +2096,7 @@ int f2fs_gc_range(struct f2fs_sb_info *sbi,
>   	if (unlikely(f2fs_cp_error(sbi)))
>   		return -EIO;
>   
> +	stat_inc_gc_call_count(sbi, FOREGROUND);
>   	for (segno = start_seg; segno <= end_seg; segno += SEGS_PER_SEC(sbi)) {
>   		struct gc_inode_list gc_list = {
>   			.ilist = LIST_HEAD_INIT(gc_list.ilist),