[PATCH cgroup/for-next] cpuset: fix missing error return in update_cpumask

Chen Ridong posted 1 patch 1 week, 5 days ago
kernel/cgroup/cpuset.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH cgroup/for-next] cpuset: fix missing error return in update_cpumask
Posted by Chen Ridong 1 week, 5 days ago
From: Chen Ridong <chenridong@huawei.com>

The commit c6366739804f ("cpuset: refactor cpus_allowed_validate_change")
inadvertently removed the error return when cpus_allowed_validate_change()
fails. This patch restores the proper error handling by returning retval
when the validation check fails.

Fixes: c6366739804f ("cpuset: refactor cpus_allowed_validate_change")
Signed-off-by: Chen Ridong <chenridong@huawei.com>
---
 kernel/cgroup/cpuset.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 506a7178f0b3..20dface3c3e0 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -2515,7 +2515,8 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
 	compute_trialcs_excpus(trialcs, cs);
 	trialcs->prs_err = PERR_NONE;
 
-	if (cpus_allowed_validate_change(cs, trialcs, &tmp) < 0)
+	retval = cpus_allowed_validate_change(cs, trialcs, &tmp);
+	if (retval < 0)
 		goto out_free;
 
 	/*
-- 
2.34.1
Re: [PATCH cgroup/for-next] cpuset: fix missing error return in update_cpumask
Posted by Tejun Heo 1 week, 5 days ago
On Fri, Sep 19, 2025 at 09:49:03AM +0000, Chen Ridong wrote:
> From: Chen Ridong <chenridong@huawei.com>
> 
> The commit c6366739804f ("cpuset: refactor cpus_allowed_validate_change")
> inadvertently removed the error return when cpus_allowed_validate_change()
> fails. This patch restores the proper error handling by returning retval
> when the validation check fails.
> 
> Fixes: c6366739804f ("cpuset: refactor cpus_allowed_validate_change")
> Signed-off-by: Chen Ridong <chenridong@huawei.com>

Applied to cgroup/for-6.18.

Thanks.

-- 
tejun
Re: [PATCH cgroup/for-next] cpuset: fix missing error return in update_cpumask
Posted by Chen Ridong 1 week, 5 days ago

On 2025/9/20 0:43, Tejun Heo wrote:
> On Fri, Sep 19, 2025 at 09:49:03AM +0000, Chen Ridong wrote:
>> From: Chen Ridong <chenridong@huawei.com>
>>
>> The commit c6366739804f ("cpuset: refactor cpus_allowed_validate_change")
>> inadvertently removed the error return when cpus_allowed_validate_change()
>> fails. This patch restores the proper error handling by returning retval
>> when the validation check fails.
>>
>> Fixes: c6366739804f ("cpuset: refactor cpus_allowed_validate_change")
>> Signed-off-by: Chen Ridong <chenridong@huawei.com>
> 
> Applied to cgroup/for-6.18.
> 
> Thanks.
> 

Thank you very much.

-- 
Best regards,
Ridong
Re: [PATCH cgroup/for-next] cpuset: fix missing error return in update_cpumask
Posted by Chen Ridong 1 week, 5 days ago

On 2025/9/19 17:49, Chen Ridong wrote:
> From: Chen Ridong <chenridong@huawei.com>
> 
> The commit c6366739804f ("cpuset: refactor cpus_allowed_validate_change")
> inadvertently removed the error return when cpus_allowed_validate_change()
> fails. This patch restores the proper error handling by returning retval
> when the validation check fails.
> 
> Fixes: c6366739804f ("cpuset: refactor cpus_allowed_validate_change")
> Signed-off-by: Chen Ridong <chenridong@huawei.com>
> ---
>  kernel/cgroup/cpuset.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index 506a7178f0b3..20dface3c3e0 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -2515,7 +2515,8 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
>  	compute_trialcs_excpus(trialcs, cs);
>  	trialcs->prs_err = PERR_NONE;
>  
> -	if (cpus_allowed_validate_change(cs, trialcs, &tmp) < 0)
> +	retval = cpus_allowed_validate_change(cs, trialcs, &tmp);
> +	if (retval < 0)
>  		goto out_free;
>  
>  	/*

Hi Longman, TJ,

Sorry about the bug introduced in patch 8. Could you please apply this patch to fix the issue?

-- 
Best regards,
Ridong