linux/mm/damon
SeongJae Park 16236b0b4a mm/damon/sysfs-scheme: cleanup access_pattern subdirs on scheme dir setup failure
commit 392b3d9d59 upstream.

When a DAMOS-scheme DAMON sysfs directory setup fails after setup of
access_pattern/ directory, subdirectories of access_pattern/ 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-5-sj@kernel.org
Fixes: 9bbb820a5b ("mm/damon/sysfs: support DAMOS quotas")
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: SeongJae Park <sj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-01-23 11:18:50 +01:00
..
tests mm/damon/tests/vaddr-kunit: handle alloc failures on damon_do_test_apply_three_regions() 2026-01-08 10:15:06 +01:00
core.c mm/damon/core: set quota->charged_from to jiffies at first charge window 2025-09-19 16:35:46 +02:00
dbgfs.c mm/damon: move kunit tests to tests/ subdirectory with _kunit suffix 2024-09-03 21:15:58 -07:00
Kconfig mm/damon/Kconfig: update DAMON doc URL 2024-09-26 14:01:44 -07:00
lru_sort.c mm/damon/lru_sort: use param_ctx for damon_attrs staging 2025-10-19 16:33:58 +02:00
Makefile mm/damon/modules: deduplicate init steps for DAMON context setup 2022-11-30 15:01:26 -08:00
modules-common.c mm/damon: update email of SeongJae 2023-12-20 14:48:13 -08:00
modules-common.h mm/damon/modules: deduplicate init steps for DAMON context setup 2022-11-30 15:01:26 -08:00
ops-common.c mm/damon/ops: have damon_get_folio return folio even for tail pages 2025-04-20 10:15:48 +02:00
ops-common.h mm/damon/ops-common: atomically test and clear young on ptes and pmds 2023-06-09 16:25:55 -07:00
paddr.c mm/damon/ops-common: ignore migration request to invalid nodes 2025-08-28 16:31:03 +02:00
reclaim.c mm/damon/reclaim: avoid divide-by-zero in damon_reclaim_apply_parameters() 2025-09-19 16:35:47 +02:00
sysfs-common.c mm/damon/sysfs: make kobj_type structures constant 2023-02-09 16:51:45 -08:00
sysfs-common.h mm/damon/sysfs-schemes: rename *_set_{schemes,scheme_filters,quota_score,schemes}() 2024-07-03 19:30:14 -07:00
sysfs-schemes.c mm/damon/sysfs-scheme: cleanup access_pattern subdirs on scheme dir setup failure 2026-01-23 11:18:50 +01:00
sysfs.c mm/damon/sysfs: cleanup attrs subdirs on context dir setup failure 2026-01-23 11:18:47 +01:00
vaddr.c mm/damon/vaddr: do not repeat pte_offset_map_lock() until success 2025-10-19 16:33:58 +02:00