mm/shrinker: fix name consistency issue in shrinker_debugfs_rename()
authorLiu Ye <liuye@kylinos.cn>
Wed, 5 Mar 2025 07:17:59 +0000 (15:17 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 17 Mar 2025 07:05:40 +0000 (00:05 -0700)
commitac55b38fe2f9b486031439c5c4ed7fce07d0d838
tree6ba3bff8e4e18412471ceba6e27dc9361c5185d1
parent9ea705a54badbc3f33daf60c2da989c24c467e77
mm/shrinker: fix name consistency issue in shrinker_debugfs_rename()

After calling debugfs_change_name function, the return value should be
checked and the old name restored.  If debugfs_change_name fails, the new
name memory should be freed.  The effect is that the shrinker->name is not
consistent with the name displayed in debugfs.

Link: https://lkml.kernel.org/r/20250305071759.661055-1-liuye@kylinos.cn
Signed-off-by: Liu Ye <liuye@kylinos.cn>
Reviewed-by: Muchun Song <muchun.song@linux.dev>
Reviewed-by:Qi Zheng <zhengqi.arch@bytedance.co
Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/shrinker_debug.c