From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 763C7301704 for ; Tue, 2 Jun 2026 18:41:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780425678; cv=none; b=DnmWPHucV2tzrvduLZYp7D9miiKLEBrzdOFnpcm3lZG6fjzg8/5sccDBLe315tXNH+3xKd2ZhkHw3oALXlERtwv9US9DOBLCFei7B7f3lF0pii/v5qk4zAmkG/vDKWzObRf9f4BnSyHvmt6R3I7iDxvJ4BI6xfh128ZFsLAomJ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780425678; c=relaxed/simple; bh=7CEOeeMkYleRQI+bsuAcOX0rDu1Ov9r/EXuZwfO4a1g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FrUWR17ojZ/3aTkAJOBTX72Ab5mmtZiSimMzF5KdnP7P2gXcXzyK/6pD8mUpUiiJswdw+oeksw5FnNnUyhgfdoIREw7nDUnmrPnOxA2Vk59pApZV/ZmXwCBpWSOpYZo8SvbWsfxelaw4aXb/uH+CedGO0oenokKF7mlbL5twdpY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=d3Ujxogm; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="d3Ujxogm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780425676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jE5wctSYjWkdf1ZgrGHwvibuILqVxW5SF0xcJklrqtk=; b=d3Ujxogm92GE8bAlwgdAa23VrbgSy+90Q2iFi2CjRqCBSmFDlfT5TKD3r5ulg5tYv+N66/ MR9fT2Y1qOyTehojG9kY3n71LLszj2dtjCSSPeCh86BbJfur0P3m31BHv6v4yo94eqohvM hR5nUwm+3EZocsa0Z2synPCvAIelv2E= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-602-UG4Rm6QUMQe1Dl5nbr1feQ-1; Tue, 02 Jun 2026 14:41:11 -0400 X-MC-Unique: UG4Rm6QUMQe1Dl5nbr1feQ-1 X-Mimecast-MFC-AGG-ID: UG4Rm6QUMQe1Dl5nbr1feQ_1780425669 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 35FD518002C7; Tue, 2 Jun 2026 18:41:09 +0000 (UTC) Received: from [10.22.80.32] (unknown [10.22.80.32]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8AAA81800352; Tue, 2 Jun 2026 18:41:07 +0000 (UTC) Message-ID: <9fad648e-4b46-4326-ae92-9a46302990cc@redhat.com> Date: Tue, 2 Jun 2026 14:41:06 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] cgroup/cpuset: Fix update_prstate() always returning 0 on partition errors To: =?UTF-8?Q?Michal_Koutn=C3=BD?= , Tao Cui Cc: chenridong@huaweicloud.com, tj@kernel.org, hannes@cmpxchg.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Tao Cui References: <20260602045521.2381230-1-cui.tao@linux.dev> Content-Language: en-US From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 On 6/2/26 3:46 AM, Michal Koutný wrote: > Hi. > > On Tue, Jun 02, 2026 at 12:55:21PM +0800, Tao Cui wrote: >> 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. > This is quite a visible UAPI change (a write can succeed to invalidate a > partition) and users are meant to watch for cpuset.cpus.partition state > anyway for asynchronous changes. Right, it is purposely done to not return a write error when writing any cpuset control files. The only exception is cpuset.cpus.exclusive which can return failure when  an exclusive CPU has been taken. It is documented in cgroup-v2.rst. Cheers, Longman