From mboxrd@z Thu Jan 1 00:00:00 1970 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 F392733987 for ; Tue, 20 Jan 2026 13:09:12 +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=1768914553; cv=none; b=vCim0RaHmVENY6MkSnRNFKB+SSQmt0MtEUuU66c9PlP743cgVZz/lMmRSpIHaUdMH3PRkAAsKUuOPu1J5lJiC7NETlViKDb+bIVMaxjqu+CG6T/81ZdKL+YMYgLV4tYZGxtWfpuzZyvSQCtXU207ZzrXKR/SrFGM8XUq3DT5Nx0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768914553; c=relaxed/simple; bh=rBoAFbQXT75Y13IObb/72eSTfgtuQ5+mSpPqVmQ+uYI=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=Gz8ka8gI6lyMolkOBH0oWNaPXi1q/VkRyz2oMpMs8HE009sTO2617mjdQyKdn6AfUunPY/IWIU8WTrsOa+YFpknH94EWEK4FXTt1J0SJU9UYLp9c9H33KZwM7fK0VIvc53HnCfvT/6d8JadqW7YbfzBuhBidgpzYxcMz6m3SMXI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LskCfIuC; 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="LskCfIuC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20FAFC16AAE; Tue, 20 Jan 2026 13:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768914552; bh=rBoAFbQXT75Y13IObb/72eSTfgtuQ5+mSpPqVmQ+uYI=; h=Subject:To:Cc:From:Date:From; b=LskCfIuCieXXQ+8RBzGBoVnZUtbVnI2W9aUQ4OzWg3c16dHy3mqqlndXxagRzUCqX qvX3wj7TPrI+rX1GCuJ7APbIZet40rX+9cCnwhjdRVULvFP9pqulKVnLQAyFSqiJCO +k88PG6WI5tXjeTV4CLL01Uo+DXnGSuWCQesd7c0= Subject: FAILED: patch "[PATCH] mm/damon/sysfs-scheme: cleanup quotas subdirs on scheme dir" failed to apply to 6.6-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:01 +0100 Message-ID: <2026012001-thud-campfire-994f@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.6-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.6.y git checkout FETCH_HEAD git cherry-pick -x dc7e1d75fd8c505096d0cddeca9e2efb2b55aaf9 # git commit -s git send-email --to '' --in-reply-to '2026012001-thud-campfire-994f@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From dc7e1d75fd8c505096d0cddeca9e2efb2b55aaf9 Mon Sep 17 00:00:00 2001 From: SeongJae Park Date: Wed, 24 Dec 2025 18:30:36 -0800 Subject: [PATCH] mm/damon/sysfs-scheme: cleanup quotas subdirs on scheme dir setup failure 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 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 30d20f5b3192..2c7a2b54be57 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -2158,7 +2158,7 @@ static int damon_sysfs_scheme_add_dirs(struct damon_sysfs_scheme *scheme) goto put_dests_out; err = damon_sysfs_scheme_set_watermarks(scheme); if (err) - goto put_quotas_access_pattern_out; + goto rmdir_put_quotas_access_pattern_out; err = damos_sysfs_set_filter_dirs(scheme); if (err) goto put_watermarks_quotas_access_pattern_out; @@ -2183,7 +2183,8 @@ static int damon_sysfs_scheme_add_dirs(struct damon_sysfs_scheme *scheme) put_watermarks_quotas_access_pattern_out: kobject_put(&scheme->watermarks->kobj); scheme->watermarks = NULL; -put_quotas_access_pattern_out: +rmdir_put_quotas_access_pattern_out: + damon_sysfs_quotas_rm_dirs(scheme->quotas); kobject_put(&scheme->quotas->kobj); scheme->quotas = NULL; put_dests_out: