From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0CAB28D8DA; Mon, 29 Jun 2026 04:55:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782708927; cv=none; b=tjzttJEAdv0gh9LcnjMl7epN+XLagPGRmxwaVNvwlYnFN+ITCxIkNReEdconM0TSfSsQvfSbbGMIIxJutapszBLabjDdKCCZnJVCQYHg06weafFBBtvV2GcrCTCFdbTVERaX7hOUATLvEIWNo3SI5E09zPid7uVKpXCBYzwNWA8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782708927; c=relaxed/simple; bh=VDyS2KUexwdQdGpfb3n5VHoxSPdYz+Jn0wgdSPi6/sY=; h=Date:To:From:Subject:Message-Id; b=DW5ow8XHop4czw3dBENs8z3cTg8FyJiHKHOvdO555nioDw98o3ydQBcHXp5LkI4PPczbBs42aSJvO+KTIMrt+bvC9imxkVaRZp8IUvntmOAGj0Fc57yR/ngpdPha2XIBYJMo6wE034TFrbChs5VJCgWgq1sX10CBbeq9DNJowSc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=wIP00Ftd; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="wIP00Ftd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98ABC1F000E9; Mon, 29 Jun 2026 04:55:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1782708925; bh=FSfYmJge6ypJS5F7/TGx5JRdrBa6lqDbRc6ijitqm1o=; h=Date:To:From:Subject; b=wIP00FtdaQEeVDoKEzG5DS6js1eX/ZSZErVeYLpgC5MR63Gh4+GjRtWE5qVwhQpIl mMp/OTF1vhmOJ2G77AIxrIk9cnadgs2hGQKxk8+bTeJBZZ5bk+s92MhQhScf1FyvWO hIt7PG70EzDjoe5UcOLNJh9r/N7vTwnOyN7gf+zM= Date: Sun, 28 Jun 2026 21:55:25 -0700 To: mm-commits@vger.kernel.org,stable@vger.kernel.org,sj@kernel.org,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-damon-sysfs-kobject_del-region-and-target-error-dirs.patch added to mm-new branch Message-Id: <20260629045525.98ABC1F000E9@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm/damon/sysfs: kobject_del() region and target (error) dirs has been added to the -mm mm-new branch. Its filename is mm-damon-sysfs-kobject_del-region-and-target-error-dirs.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-damon-sysfs-kobject_del-region-and-target-error-dirs.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. The mm-new branch of mm.git is not included in linux-next If a few days of testing in mm-new is successful, the patch will me moved into mm.git's mm-unstable branch, which is included in linux-next Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: SJ Park Subject: mm/damon/sysfs: kobject_del() region and target (error) dirs Date: Sun, 28 Jun 2026 15:01:11 -0700 On CONFIG_DEBUG_KOBJECT_RELEASE enabled kernel, lack of kobject_del() could cause directories creation failures due to the name conflicts. Fix those issues for the normal creation path of region directories and the error path of target directories, by adding kobject_del() calls. Link: https://lore.kernel.org/20260628220121.97360-3-sj@kernel.org Fixes: 2031b14ea757 ("mm/damon/sysfs: support the physical address space monitoring") Signed-off-by: SJ Park Cc: # 5.18.x Signed-off-by: Andrew Morton --- mm/damon/sysfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/mm/damon/sysfs.c~mm-damon-sysfs-kobject_del-region-and-target-error-dirs +++ a/mm/damon/sysfs.c @@ -105,8 +105,10 @@ static void damon_sysfs_regions_rm_dirs( struct damon_sysfs_region **regions_arr = regions->regions_arr; int i; - for (i = 0; i < regions->nr; i++) + for (i = 0; i < regions->nr; i++) { + kobject_del(®ions_arr[i]->kobj); kobject_put(®ions_arr[i]->kobj); + } regions->nr = 0; kfree(regions_arr); regions->regions_arr = NULL; @@ -370,13 +372,15 @@ static int damon_sysfs_targets_add_dirs( err = damon_sysfs_target_add_dirs(target); if (err) - goto out; + goto del_out; targets_arr[i] = target; targets->nr++; } return 0; +del_out: + kobject_del(&target->kobj); out: damon_sysfs_targets_rm_dirs(targets); kobject_put(&target->kobj); _ Patches currently in -mm which might be from sj@kernel.org are mm-damon-sysfs-schemes-fix-dir-put-orders-in-access_pattern_add_dirs.patch mm-damon-sysfs-schemes-put-stats-for-scheme_add_dirs-internal-error.patch mm-damon-ops-common-handle-extreme-intervals-in-damon_hot_score.patch maintainers-s-seongjae-sj.patch samples-damon-wsse-handle-damon_start-failure.patch samples-damon-prcl-handle-damon_start-failure.patch samples-damon-mtier-handle-damon_start-failure.patch samples-damon-mtier-handle-damon_stop-failure.patch samples-damon-wsse-stop-and-free-damon-ctx-when-damon_call-fails.patch samples-damon-prcl-stop-and-free-damon-ctx-when-damon_call-fails.patch mm-damon-sysfs-kobject_del-target-normal-context-and-kdamond-dirs.patch mm-damon-sysfs-kobject_del-region-and-target-error-dirs.patch mm-damon-sysfs-schemes-kobject_del-scheme-dirs.patch mm-damon-sysfs-schemes-kobject_del-scheme-region-dirs.patch mm-damon-sysfs-schemes-kobject_del-scheme-filter-dirs.patch mm-damon-sysfs-schemes-kobject_del-scheme-quota-goal-dirs.patch mm-damon-sysfs-schemes-kobject_del-scheme-action-destination-dirs.patch mm-damon-sysfs-kobject_del-probe-dirs.patch mm-damon-sysfs-kobject_del-probe-filter-dirs.patch mm-damon-sysfs-kobject_del-probe-dirs-in-probes_addd_dir-error-path.patch mm-damon-sysfs-schemes-kobject_del-region-for-populate_region-error.patch