Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 BCFB43EFD11 for ; Tue, 20 Jan 2026 13:09:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768914558; cv=none; b=l5U3YNp4PCL1s7diL95u79DkhGgAm7Fp4wZePc1euGWVF3fK4iLfBNGTzxp6iNOb+oBVOY4Ej1ZqwyoXt7G+3cRhRKtCVcMJtXIEC7XcR8jhkChHOmdEyUkvRG9F+c4i943dyN4TlRpxYhUNZBJEQsTX32QBu2PCB5qaCpRCNT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768914558; c=relaxed/simple; bh=4SpEepvnEPVgrkivfKk2AFl0u4nWutzqNakYpKE1eRc=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=Af9SY1uSt/uUHbwSfnkH+Yl9z13Cie7U8BJMr50LtTpRgsF6Yuw8T4UBUTL48G9y2xZn4PD4d6LGTBKCbdQj653dQSJI/Wj1KXF+tRkkFih+fr3z1AEbT558eEV2Yr9jvLuBOYVXt3w9zZGng7EOZpajSPX8jEqslHWZXfonym8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RunK2Y5W; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="RunK2Y5W" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1E93C16AAE; Tue, 20 Jan 2026 13:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768914558; bh=4SpEepvnEPVgrkivfKk2AFl0u4nWutzqNakYpKE1eRc=; h=Subject:To:Cc:From:Date:From; b=RunK2Y5W1b80WacOKlryBv8B7aHQfMKZDJV2lG3YjIk3hzoldJ+Sv3vbm/K84z7Nw hQR4r5FAcngMqOTOK59OvLjpvn2aEoqRmTfY7LmXiJWmnnK5/NHLwvewQzLhtBShS4 qZJy0wp6d6KtUStDVZ60lb5w5lOQ4zpPtt2lRRKU= Subject: FAILED: patch "[PATCH] mm/damon/sysfs-scheme: cleanup access_pattern subdirs on" failed to apply to 6.12-stable tree To: sj@kernel.org,akpm@linux-foundation.org,jiapeng.chong@linux.alibaba.com,stable@vger.kernel.org Cc: From: Date: Tue, 20 Jan 2026 14:09:14 +0100 Message-ID: <2026012014-pesky-canola-55d1@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.12-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y git checkout FETCH_HEAD git cherry-pick -x 392b3d9d595f34877dd745b470c711e8ebcd225c # git commit -s git send-email --to '' --in-reply-to '2026012014-pesky-canola-55d1@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ From 392b3d9d595f34877dd745b470c711e8ebcd225c Mon Sep 17 00:00:00 2001 From: SeongJae Park Date: Wed, 24 Dec 2025 18:30:37 -0800 Subject: [PATCH] mm/damon/sysfs-scheme: cleanup access_pattern subdirs on scheme dir setup failure 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: 9bbb820a5bd5 ("mm/damon/sysfs: support DAMOS quotas") Signed-off-by: SeongJae Park Cc: chongjiapeng Cc: # 5.18.x Signed-off-by: Andrew Morton diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index 2c7a2b54be57..3a699dcd5a7f 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -2152,7 +2152,7 @@ static int damon_sysfs_scheme_add_dirs(struct damon_sysfs_scheme *scheme) return err; err = damos_sysfs_set_dests(scheme); if (err) - goto put_access_pattern_out; + goto rmdir_put_access_pattern_out; err = damon_sysfs_scheme_set_quotas(scheme); if (err) goto put_dests_out; @@ -2190,7 +2190,8 @@ static int damon_sysfs_scheme_add_dirs(struct damon_sysfs_scheme *scheme) put_dests_out: kobject_put(&scheme->dests->kobj); scheme->dests = NULL; -put_access_pattern_out: +rmdir_put_access_pattern_out: + damon_sysfs_access_pattern_rm_dirs(scheme->access_pattern); kobject_put(&scheme->access_pattern->kobj); scheme->access_pattern = NULL; return err;