Re: [PATCH v2 v2 2/2] ext4: allow clearing mballoc stats through mb_stats

Ojaswin Mujoo
2026-04-20T09:12:58Z

On Sun, Apr 19, 2026 at 02:34:36PM +0800, Baolin Liu wrote:
> From: Baolin Liu <liubaolin@kylinos.cn>
>
> Make /proc/fs/ext4/<dev>/mb_stats writable and clear the runtime
> mballoc statistics when 0 is written.
>
> Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
> ---
Hi Baolin, thanks for the changes.

Seems like userspace doesn't have any way to know that writing 0 will
clear the that. Well, I guess if you are looking at this file you are
anyways debugging kernel code so that should be fine

Feel free to add:

Ojaswin Mujoo <ojaswin@linux.ibm.com>

Regards,
ojaswin

> fs/ext4/ext4.h | 1 +
> fs/ext4/mballoc.c | 29 +++++++++++++++++++++++++++++
> fs/ext4/sysfs.c | 40 ++++++++++++++++++++++++++++++++++++++--
> 3 files changed, 68 insertions(+), 2 deletions(-)
>