Skip to contentSkip to conversation

mm-damon-core-kunit-extend-damos_commit_filter_for-for-wrong-input.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Oct 13 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/damon/core-kunit: extend damos_commit_filter_for() for wrong input
has been removed from the -mm tree. Its filename was
mm-damon-core-kunit-extend-damos_commit_filter_for-for-wrong-input.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 <[email protected]>
Subject: mm/damon/core-kunit: extend damos_commit_filter_for() for wrong input
Date: Mon, 14 Sep 2026 07:23:24 -0700

damos_commit_filter_for() supposes damos_commit_filter() to always succeed with given inputs. damos_commit_filter() could return an error for invalid inputs. Existing callers always pass only valid inputs, but they may pass invalid inputs in future, for test purposes. Extend the function to be able to be used for wrong inputs-caused error testing.

---

 mm/damon/tests/core-kunit.h |   24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)
mm/damon/tests/core-kunit.h renamed from mm/damon/tests/core-kunit.h~mm-damon-core-kunit-extend-damos_commit_filter_for-for-wrong-input +15 -9
@@ -1116,9 +1116,15 @@ static void damos_test_commit_dests(stru
 }
 
 static void damos_test_commit_filter_for(struct kunit *test,
-		struct damos_filter *dst, struct damos_filter *src)
+		struct damos_filter *dst, struct damos_filter *src,
+		bool expect_fail)
 {
-	damos_commit_filter(dst, src);
+	int err;
+
+	err = damos_commit_filter(dst, src);
+	KUNIT_EXPECT_EQ(test, err != 0, expect_fail);
+	if (expect_fail)
+		return;
 	KUNIT_EXPECT_EQ(test, dst->type, src->type);
 	KUNIT_EXPECT_EQ(test, dst->matching, src->matching);
 	KUNIT_EXPECT_EQ(test, dst->allow, src->allow);
@@ -1157,47 +1163,47 @@ static void damos_test_commit_filter(str
 			.type = DAMOS_FILTER_TYPE_ANON,
 			.matching = true,
 			.allow = true,
-			});
+			}, false);
 	damos_test_commit_filter_for(test, &dst,
 			&(struct damos_filter){
 			.type = DAMOS_FILTER_TYPE_MEMCG,
 			.matching = false,
 			.allow = false,
 			.memcg_id = 123,
-			});
+			}, false);
 	damos_test_commit_filter_for(test, &dst,
 			&(struct damos_filter){
 			.type = DAMOS_FILTER_TYPE_YOUNG,
 			.matching = true,
 			.allow = true,
-			});
+			}, false);
 	damos_test_commit_filter_for(test, &dst,
 			&(struct damos_filter){
 			.type = DAMOS_FILTER_TYPE_HUGEPAGE_SIZE,
 			.matching = false,
 			.allow = false,
 			.sz_range = {.min = 234, .max = 345},
-			});
+			}, false);
 	damos_test_commit_filter_for(test, &dst,
 			&(struct damos_filter){
 			.type = DAMOS_FILTER_TYPE_UNMAPPED,
 			.matching = true,
 			.allow = true,
-			});
+			}, false);
 	damos_test_commit_filter_for(test, &dst,
 			&(struct damos_filter){
 			.type = DAMOS_FILTER_TYPE_ADDR,
 			.matching = false,
 			.allow = false,
 			.addr_range = {.start = 456, .end = 567},
-			});
+			}, false);
 	damos_test_commit_filter_for(test, &dst,
 			&(struct damos_filter){
 			.type = DAMOS_FILTER_TYPE_TARGET,
 			.matching = true,
 			.allow = true,
 			.target_idx = 6,
-			});
+			}, false);
 }
 
 static void damos_test_help_initailize_scheme(struct damos *scheme)

_

Patches currently in -mm which might be from [email protected] 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