[PATCH RESEND -next 17/21] cpuset: use validate_local_partition in local_partition_enable

From: Chen Ridong
Date: Thu Dec 25 2025 - 07:52:44 EST


From: Chen Ridong <chenridong@xxxxxxxxxx>

Replace the partition error checks within `local_partition_enable()` by
utilizing the common `validate_local_partition()` function.

Signed-off-by: Chen Ridong <chenridong@xxxxxxxxxx>
---
kernel/cgroup/cpuset.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 96a82a3e9add..183975c86d0c 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -1796,16 +1796,6 @@ static int local_partition_enable(struct cpuset *cs,
lockdep_assert_held(&cpuset_mutex);
WARN_ON_ONCE(is_remote_partition(cs)); /* For local partition only */

- /*
- * The parent must be a partition root.
- * The new cpumask, if present, or the current cpus_allowed must
- * not be empty.
- */
- if (!is_partition_valid(parent)) {
- return is_partition_invalid(parent)
- ? PERR_INVPARENT : PERR_NOTPART;
- }
-
/*
* Need to call compute_excpus() in case
* exclusive_cpus not set. Sibling conflict should only happen
@@ -1814,7 +1804,7 @@ static int local_partition_enable(struct cpuset *cs,
if (compute_excpus(cs, tmp->new_cpus))
WARN_ON_ONCE(!cpumask_empty(cs->exclusive_cpus));

- err = validate_partition(cs, new_prs, tmp->new_cpus, tmp->new_cpus, NULL);
+ err = validate_local_partition(cs, new_prs, tmp->new_cpus, false, NULL);
if (err)
return err;

--
2.34.1