* [merged mm-stable] mm-damon-core-return-an-error-from-damos_commit_filter_arg.patch removed from -mm tree
@ 2026-10-13 4:31 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-10-13 4:31 UTC (permalink / raw)
To: mm-commits, usamaarif642, stable, kunwu.chan, davidgow,
brendan.higgins, sj, akpm
The quilt patch titled
Subject: mm/damon/core: return an error from damos_commit_filter_arg()
has been removed from the -mm tree. Its filename was
mm-damon-core-return-an-error-from-damos_commit_filter_arg.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: SJ Park <sj@kernel.org>
Subject: mm/damon/core: return an error from damos_commit_filter_arg()
Date: Mon, 14 Sep 2026 07:23:20 -0700
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(-)
--- a/mm/damon/core.c~mm-damon-core-return-an-error-from-damos_commit_filter_arg
+++ a/mm/damon/core.c
@@ -1317,7 +1317,7 @@ static struct damos_filter *damos_nth_op
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(str
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(str
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(stru
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;
_
Patches currently in -mm which might be from sj@kernel.org are
mm-damon-core-introduce-damos_quota_goal-complement.patch
mm-damon-core-add-complement-argument-to-damos_new_quota_goal.patch
mm-damon-sysfs-schemes-support-quota-goal-complement-flag.patch
mm-damon-tests-core-kunit-test-quota_goal-complement-commit.patch
selftests-damon-sysfssh-test-quota-goal-complement-flag-file.patch
docs-mm-damon-design-document-damos-quota-goal-complement-flag.patch
docs-admin-guide-mm-damon-usage-update-for-quota-goal-complement-file.patch
docs-abi-damon-update-for-quota-goal-metric-complement-sysfs-file.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-13 4:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13 4:31 [merged mm-stable] mm-damon-core-return-an-error-from-damos_commit_filter_arg.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.