]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm/damon/sysfs-scheme: cleanup quotas subdirs on scheme dir setup failure
authorSeongJae Park <sj@kernel.org>
Thu, 25 Dec 2025 02:30:36 +0000 (18:30 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Jan 2026 09:27:41 +0000 (10:27 +0100)
commit5596ce564a8c3168cfa8fb1b2e1e52fc09e9aa51
tree496b138f7855978b7e22ee0751d866f9d3491172
parente9711bd0e64812c694a228cf58c9e6032decee54
mm/damon/sysfs-scheme: cleanup quotas subdirs on scheme dir setup failure

commit dc7e1d75fd8c505096d0cddeca9e2efb2b55aaf9 upstream.

When a DAMOS-scheme DAMON sysfs directory setup fails after setup of
quotas/ directory, subdirectories of quotas/ directory are not cleaned up.
As a result, DAMON sysfs interface is nearly broken until the system
reboots, and the memory for the unremoved directory is leaked.

Cleanup the directories under such failures.

Link: https://lkml.kernel.org/r/20251225023043.18579-4-sj@kernel.org
Fixes: 1b32234ab087 ("mm/damon/sysfs: support DAMOS watermarks")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: chongjiapeng <jiapeng.chong@linux.alibaba.com>
Cc: <stable@vger.kernel.org> # 5.18.x
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/damon/sysfs-schemes.c