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: linux-kernel@vger.kernel.org, Tao Cui <cuitao@kylinos.cn>,
"Claude Opus 4 . 7" <noreply@anthropic.com>
Subject: [PATCH] cgroup/cpuset: Fix update_prstate() always returning 0 on partition errors
Date: Tue, 2 Jun 2026 12:36:52 +0800 [thread overview]
Message-ID: <20260602043652.2380163-1-cui.tao@linux.dev> (raw)
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;
--
2.43.0
next reply other threads:[~2026-06-02 4:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 4:36 Tao Cui [this message]
2026-06-02 4:49 ` [PATCH] cgroup/cpuset: Fix update_prstate() always returning 0 on partition errors Tao Cui
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=20260602043652.2380163-1-cui.tao@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.