From: Tao Cui <cui.tao@linux.dev>
To: longman@redhat.com, chenridong@huaweicloud.com, tj@kernel.org,
hannes@cmpxchg.org, mkoutny@suse.com, cgroups@vger.kernel.org
Cc: cui.tao@linux.dev, linux-kernel@vger.kernel.org,
Tao Cui <cuitao@kylinos.cn>,
"Claude Opus 4 . 7" <noreply@anthropic.com>
Subject: Re: [PATCH] cgroup/cpuset: Fix update_prstate() always returning 0 on partition errors
Date: Tue, 2 Jun 2026 12:49:15 +0800 [thread overview]
Message-ID: <39c542a0-bf0f-408c-a9ff-17b4c629bd36@linux.dev> (raw)
In-Reply-To: <20260602043652.2380163-1-cui.tao@linux.dev>
Kindly disregard this patch.
The issue is fixed by AI auto-testing without Signed-off-by; the tag will be included in v2.
在 2026/6/2 12:36, Tao Cui 写道:
> From: Tao Cui <cuitao@kylinos.cn>
>
> update_prstate() stores the error code in cs->prs_err and transitions
> the partition to an invalid state, but always returns 0. The caller
> cpuset_partition_write() uses "return retval ?: nbytes", so the write
> syscall always appears to succeed from userspace even when the partition
> became invalid. Return -EINVAL when err is set so userspace can detect
> the failure immediately.
>
> Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
> ---
> kernel/cgroup/cpuset.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index 591e3aa487fc..8605b4da610e 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -2965,7 +2965,7 @@ static int update_prstate(struct cpuset *cs, int new_prs)
> if (force_sd_rebuild)
> rebuild_sched_domains_locked();
> free_tmpmasks(&tmpmask);
> - return 0;
> + return err ? -EINVAL : 0;
> }
>
> static struct cpuset *cpuset_attach_old_cs;
prev parent reply other threads:[~2026-06-02 4:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 4:36 [PATCH] cgroup/cpuset: Fix update_prstate() always returning 0 on partition errors Tao Cui
2026-06-02 4:49 ` Tao Cui [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=39c542a0-bf0f-408c-a9ff-17b4c629bd36@linux.dev \
--to=cui.tao@linux.dev \
--cc=cgroups@vger.kernel.org \
--cc=chenridong@huaweicloud.com \
--cc=cuitao@kylinos.cn \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mkoutny@suse.com \
--cc=noreply@anthropic.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.