From nobody Fri Apr 26 19:11:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=ucloud.cn Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153925939211467.13829276109232; Thu, 11 Oct 2018 05:03:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C7252307D86F; Thu, 11 Oct 2018 12:03:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3134E66A1B; Thu, 11 Oct 2018 12:03:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B459A3D61; Thu, 11 Oct 2018 12:03:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9B8DdSW020627 for ; Thu, 11 Oct 2018 04:13:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0280F2D352; Thu, 11 Oct 2018 08:13:39 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EBF49608EE for ; Thu, 11 Oct 2018 08:13:34 +0000 (UTC) Received: from m97134.mail.qiye.163.com (m97134.mail.qiye.163.com [220.181.97.134]) by mx1.redhat.com (Postfix) with ESMTP id 6B16C308A953 for ; Thu, 11 Oct 2018 08:13:24 +0000 (UTC) Received: from localhost.localdomain (unknown [120.132.1.243]) by smtp5 (Coremail) with SMTP id huCowADXTmMiBr9bZEnHAg--.196S2; Thu, 11 Oct 2018 16:13:23 +0800 (CST) From: Bingsong Si To: libvir-list@redhat.com Date: Thu, 11 Oct 2018 16:13:08 +0800 Message-Id: <20181011081308.3294-1-owen.si@ucloud.cn> X-CM-TRANSID: huCowADXTmMiBr9bZEnHAg--.196S2 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxUefHjDUUUU X-Originating-IP: [120.132.1.243] X-CM-SenderInfo: hrzh0h1vl63uhorxvhdfq/1tbiHQPcH1pcg6Mv6QAAs9 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 214 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 11 Oct 2018 08:13:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 11 Oct 2018 08:13:25 +0000 (UTC) for IP:'220.181.97.134' DOMAIN:'m97134.mail.qiye.163.com' HELO:'m97134.mail.qiye.163.com' FROM:'owen.si@ucloud.cn' RCPT:'' X-RedHat-Spam-Score: -0.011 (RCVD_IN_DNSWL_NONE, SPF_PASS) 220.181.97.134 m97134.mail.qiye.163.com 220.181.97.134 m97134.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Thu, 11 Oct 2018 08:03:06 -0400 Subject: [libvirt] [PATCH] libvirtd: fix potential deadlock when starting vm X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 11 Oct 2018 12:03:10 +0000 (UTC) X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" On CentOS 6, udev_monitor_receive_device will block until the socket becomes readable, udevEventHandleThread will hold the lock all the time and udevEventHandleCallback hard to get the lock, will block the event poll. To fix this, set dataReady to false after receive an udev event. Signed-off-by: Bingsong Si --- src/node_device/node_device_udev.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 22897591de..ce1101d7cc 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1616,6 +1616,7 @@ udevEventHandleThread(void *opaque ATTRIBUTE_UNUSED) =20 errno =3D 0; device =3D udev_monitor_receive_device(priv->udev_monitor); + priv->dataReady =3D false; virObjectUnlock(priv); =20 if (!device) { @@ -1637,10 +1638,6 @@ udevEventHandleThread(void *opaque ATTRIBUTE_UNUSED) return; } =20 - virObjectLock(priv); - priv->dataReady =3D false; - virObjectUnlock(priv); - continue; } =20 --=20 2.18.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list