From nobody Fri May 3 15:34:26 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1583227696; cv=none; d=zohomail.com; s=zohoarc; b=gN2I3Nfjg5Ry+qAnHv4yHiypgDfBijWqO5D9y3tlBDFbr6Wqv3uRolZbksR1bnjh1FEoEVwhZankb/gW93Ph1KmkKMJZ8cqfQ9AlmzfrEhIAVdf30ZxWeNF3gIvHO4a1y7WTTSaQwCF8WXycgOPte7mxhnZLKhsAv8McX/SqOcM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583227696; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=A9J618pZf7fYM5M45/BOdQQFiDkJH/Ir9qBMXC1XNYU=; b=Wz+rNZeCemMEWvPl+Y5nkVLmaj0HSd0hJyZfl8fGDMkGBSNdmRoFxs41pR5bU6sBELEiVsYQjhM8w7TxPABW3QZvnINgb02DLfKLV0gmSewRETGO19FgiEdWAMC6WEliVozJScl2A5+ntYGASFsBUxFYbYpPuYG09oJhm5yj0TI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1583227696070384.60762743994314; Tue, 3 Mar 2020 01:28:16 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j93px-0004Jw-JQ; Tue, 03 Mar 2020 09:27:37 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j93px-0004Jr-2H for xen-devel@lists.xenproject.org; Tue, 03 Mar 2020 09:27:37 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 37abfd22-5d31-11ea-a0c5-12813bfff9fa; Tue, 03 Mar 2020 09:27:36 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2A8F2AF4C; Tue, 3 Mar 2020 09:27:35 +0000 (UTC) X-Inumbo-ID: 37abfd22-5d31-11ea-a0c5-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Tue, 3 Mar 2020 10:27:33 +0100 Message-Id: <20200303092733.14983-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH v2] xen/sched: fix error path in cpupool_unassign_cpu_start() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , George Dunlap , Dario Faggioli MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" In case moving away all domains from the cpu to be removed is failing in cpupool_unassign_cpu_start() the error path is missing to release sched_res_rculock. The normal exit path is releasing domlist_read_lock instead (this is currently no problem as the reference to the specific rcu lock is not used by rcu_read_unlock()). While at it indent the present error label by one space. Reported-by: Igor Druzhinin Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Reviewed-by: Dario Faggioli --- V2: - indent error labels (Jan Beulich) --- xen/common/sched/cpupool.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c index b7721b5d02..9f70c7ec17 100644 --- a/xen/common/sched/cpupool.c +++ b/xen/common/sched/cpupool.c @@ -466,7 +466,7 @@ static int cpupool_unassign_cpu_start(struct cpupool *c= , unsigned int cpu) } rcu_read_unlock(&domlist_read_lock); if ( ret ) - goto out; + goto out_rcu; } cpupool_moving_cpu =3D cpu; atomic_inc(&c->refcnt); @@ -474,8 +474,9 @@ static int cpupool_unassign_cpu_start(struct cpupool *c= , unsigned int cpu) cpumask_andnot(c->cpu_valid, c->cpu_valid, cpus); cpumask_and(c->res_valid, c->cpu_valid, &sched_res_mask); =20 - rcu_read_unlock(&domlist_read_lock); -out: + out_rcu: + rcu_read_unlock(&sched_res_rculock); + out: spin_unlock(&cpupool_lock); =20 return ret; --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel