* FAILED: patch "[PATCH] mm/damon/core: return an error from damos_commit_filter_arg()" failed to apply to 5.10-stable tree
@ 2026-11-07 11:21 Sasha Levin
2026-11-07 17:09 ` SJ Park
0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2026-11-07 11:21 UTC (permalink / raw)
To: sj, akpm, kunwu.chan, brendan.higgins, davidgow, usamaarif642; +Cc: stable
The patch below does not apply to the 5.10-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 <stable@vger.kernel.org>.
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-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 6f276422aded370174edea69549ebe6b1683ffcc
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '20261107062110-failed-5.10-6f276422aded@kernel.org' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 6f276422aded370174edea69549ebe6b1683ffcc Mon Sep 17 00:00:00 2001
From: SJ Park <sj@kernel.org>
Date: Mon, 14 Sep 2026 07:23:20 -0700
Subject: [PATCH] mm/damon/core: return an error from damos_commit_filter_arg()
damos_commit_filter_arg() is supposed to always succeed. It may not in
future, for example, if the given filter is invalid. Prepare the case by
modifying its signature to return an error when it failed. Also pipe the
return value to its callers and let them handle the error.
Link: https://lore.kernel.org/20260914142327.92510-4-sj@kernel.org
Signed-off-by: SJ Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Kunwu Chan <kunwu.chan@gmail.com>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@davidgow.net>
Cc: Usama Arif <usamaarif642@gmail.com>
Cc: <stable@vger.kernel.org>
---
mm/damon/core.c | 41 ++++++++++++++++++++++++++++-------------
1 file changed, 28 insertions(+), 13 deletions(-)
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 38383ced3dd6c..1932a50252079 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -1317,7 +1317,7 @@ static struct damos_filter *damos_nth_ops_filter(int n, struct damos *s)
return NULL;
}
-static void damos_commit_filter_arg(
+static int damos_commit_filter_arg(
struct damos_filter *dst, struct damos_filter *src)
{
switch (dst->type) {
@@ -1340,28 +1340,32 @@ static void damos_commit_filter_arg(
default:
break;
}
+ return 0;
}
-static void damos_commit_filter(
+static int damos_commit_filter(
struct damos_filter *dst, struct damos_filter *src)
{
dst->type = src->type;
dst->matching = src->matching;
dst->allow = src->allow;
- damos_commit_filter_arg(dst, src);
+ return damos_commit_filter_arg(dst, src);
}
static int damos_commit_core_filters(struct damos *dst, struct damos *src)
{
struct damos_filter *dst_filter, *next, *src_filter, *new_filter;
- int i = 0, j = 0;
+ int i = 0, j = 0, err;
damos_for_each_core_filter_safe(dst_filter, next, dst) {
src_filter = damos_nth_core_filter(i++, src);
- if (src_filter)
- damos_commit_filter(dst_filter, src_filter);
- else
+ if (src_filter) {
+ err = damos_commit_filter(dst_filter, src_filter);
+ if (err)
+ return err;
+ } else {
damos_destroy_filter(dst_filter);
+ }
}
damos_for_each_core_filter_safe(src_filter, next, src) {
@@ -1373,7 +1377,11 @@ static int damos_commit_core_filters(struct damos *dst, struct damos *src)
src_filter->allow);
if (!new_filter)
return -ENOMEM;
- damos_commit_filter_arg(new_filter, src_filter);
+ err = damos_commit_filter_arg(new_filter, src_filter);
+ if (err) {
+ damos_destroy_filter(new_filter);
+ return err;
+ }
damos_add_filter(dst, new_filter);
}
return 0;
@@ -1382,14 +1390,17 @@ static int damos_commit_core_filters(struct damos *dst, struct damos *src)
static int damos_commit_ops_filters(struct damos *dst, struct damos *src)
{
struct damos_filter *dst_filter, *next, *src_filter, *new_filter;
- int i = 0, j = 0;
+ int i = 0, j = 0, err;
damos_for_each_ops_filter_safe(dst_filter, next, dst) {
src_filter = damos_nth_ops_filter(i++, src);
- if (src_filter)
- damos_commit_filter(dst_filter, src_filter);
- else
+ if (src_filter) {
+ err = damos_commit_filter(dst_filter, src_filter);
+ if (err)
+ return err;
+ } else {
damos_destroy_filter(dst_filter);
+ }
}
damos_for_each_ops_filter_safe(src_filter, next, src) {
@@ -1401,7 +1412,11 @@ static int damos_commit_ops_filters(struct damos *dst, struct damos *src)
src_filter->allow);
if (!new_filter)
return -ENOMEM;
- damos_commit_filter_arg(new_filter, src_filter);
+ err = damos_commit_filter_arg(new_filter, src_filter);
+ if (err) {
+ damos_destroy_filter(new_filter);
+ return err;
+ }
damos_add_filter(dst, new_filter);
}
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: FAILED: patch "[PATCH] mm/damon/core: return an error from damos_commit_filter_arg()" failed to apply to 5.10-stable tree
2026-11-07 11:21 FAILED: patch "[PATCH] mm/damon/core: return an error from damos_commit_filter_arg()" failed to apply to 5.10-stable tree Sasha Levin
@ 2026-11-07 17:09 ` SJ Park
2026-11-07 21:12 ` SJ Park
0 siblings, 1 reply; 3+ messages in thread
From: SJ Park @ 2026-11-07 17:09 UTC (permalink / raw)
To: Sasha Levin
Cc: SJ Park, akpm, kunwu.chan, brendan.higgins, davidgow,
usamaarif642, stable
On Sat, 7 Nov 2026 06:21:10 -0500 Sasha Levin <sashal@kernel.org> wrote:
> The patch below does not apply to the 5.10-stable tree.
5.15 is the first release that got DAMON be merged. Why are you trying to add
a DAMON patch to 5.10.y?
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: FAILED: patch "[PATCH] mm/damon/core: return an error from damos_commit_filter_arg()" failed to apply to 5.10-stable tree
2026-11-07 17:09 ` SJ Park
@ 2026-11-07 21:12 ` SJ Park
0 siblings, 0 replies; 3+ messages in thread
From: SJ Park @ 2026-11-07 21:12 UTC (permalink / raw)
To: SJ Park
Cc: Sasha Levin, akpm, kunwu.chan, brendan.higgins, davidgow,
usamaarif642, stable
On Sat, 7 Nov 2026 09:09:45 -0800 SJ Park <sj@kernel.org> wrote:
> On Sat, 7 Nov 2026 06:21:10 -0500 Sasha Levin <sashal@kernel.org> wrote:
>
> > The patch below does not apply to the 5.10-stable tree.
>
> 5.15 is the first release that got DAMON be merged. Why are you trying to add
> a DAMON patch to 5.10.y?
Seems that's because the patch has Cc:stable@ but Fixes:.
DAMON patches having Cc:stable@ but Fixes: can be considered as wrongly having
stable@, and therefore ok to be ignored. Please ignore this and all DAMON
patch cherry-pick failures to <5.15 kernels.
For more details about how such wrong Cc could be made, refer to [1].
[1] https://lore.kernel.org/20261107194352.198354-1-sj@kernel.org/
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-07 21:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-07 11:21 FAILED: patch "[PATCH] mm/damon/core: return an error from damos_commit_filter_arg()" failed to apply to 5.10-stable tree Sasha Levin
2026-11-07 17:09 ` SJ Park
2026-11-07 21:12 ` SJ Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox