From nobody Sat May 4 00:39:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588848566; cv=none; d=zohomail.com; s=zohoarc; b=ApQoI4b3/3i/tdOKDshg0EWat7aY7HM+ckxMciwE9bEgmanIh0BVjyGnfE/y4wwr2wKSgu5cVdsYAYwUM/LXanHD4jIq+b4XEy0PGsUYIfN++5FajUtHyIN5yq0fjydUfRpD6D+KUUNKRoJvu92XpCOaZ/LIijtL2+Cv7EfKt3k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588848566; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=wZkf7MMw7dR9OpOCgUm/avHzKd1MWnFF3hxr3VWww1w=; b=UFDH7kCqMpDsny/GdBun+nhYAmUb398w1diTsFqHAz6/ZZSgvIcWgays91gDlJO7adFi/1sGVR100sIDEOyIRYJGznSgXyc0m9OVZ2HNjwjD/gnaEhb/wynhWBy7acZ/3kaKI40gFqZD0BrIVl0uDjdEhM17zzf2R8i5xHlqbc4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1588848565822966.4685307130818; Thu, 7 May 2020 03:49:25 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-97-OmN0FGoyPnCbYyWSQb38Pg-1; Thu, 07 May 2020 06:49:22 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1AC3A1895943; Thu, 7 May 2020 10:49:17 +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 913615C1BE; Thu, 7 May 2020 10:49:16 +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 AED0D4CAA0; Thu, 7 May 2020 10:49:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 047AnCYk006508 for ; Thu, 7 May 2020 06:49:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 888A2108BDB; Thu, 7 May 2020 10:49:12 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 83DD4F7FBE for ; Thu, 7 May 2020 10:49:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9D4F1833B46 for ; Thu, 7 May 2020 10:49:09 +0000 (UTC) Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.70.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-477-0sW_rKGaOU-rkvQIe7g7LA-1; Thu, 07 May 2020 06:49:06 -0400 Received: from localhost (unknown [192.168.167.139]) by regular1.263xmail.com (Postfix) with ESMTP id 093E43DD for ; Thu, 7 May 2020 18:49:03 +0800 (CST) Received: from localhost.localdomain (unknown [14.18.236.69]) by smtp.263.net (postfix) whith ESMTP id P10747T140188381705984S1588848537339829_; Thu, 07 May 2020 18:49:02 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588848564; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=wZkf7MMw7dR9OpOCgUm/avHzKd1MWnFF3hxr3VWww1w=; b=LYTNIiRWI4ipKEBlM8jShyIu07oC5Sa+4HcFNDbWpnzGjyKmNtjtVsVFbQUIukmHtBgQzm I1RrjBoRv7uWfp8Fj8aQWzB2EhZy1y3GNZ6g6Vz9cD1QPwHnZ0LqCMuKzUZEZ4Ly6oYtUX rK5jRSC/+Whl7ah9jhHK73NWdjFN5g8= X-MC-Unique: OmN0FGoyPnCbYyWSQb38Pg-1 X-MC-Unique: 0sW_rKGaOU-rkvQIe7g7LA-1 X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-SKE-CHECKED: 1 X-ABS-CHECKED: 1 X-IP-DOMAINF: 1 X-UNIQUE-TAG: <88a3e25d594bc9df6f397dc7fc7237fd> X-RL-SENDER: yili@winhong.com X-SENDER: yili@winhong.com X-LOGIN-NAME: yili@winhong.com X-FST-TO: libvir-list@redhat.com X-SENDER-IP: 14.18.236.69 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 From: Yi Li To: libvir-list@redhat.com Subject: [PATCH] Unlock the storage pool objects after looking it up Date: Thu, 7 May 2020 18:48:55 +0800 Message-Id: <20200507104855.2868736-1-yili@winhong.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 047AnCYk006508 X-loop: libvir-list@redhat.com Cc: yilikernel@gmail.com, yili@winhong.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The lock should be released. Signed-off-by: Yi Li --- src/conf/virstorageobj.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c index 13b75b648d..9f24ae67ca 100644 --- a/src/conf/virstorageobj.c +++ b/src/conf/virstorageobj.c @@ -2077,8 +2077,10 @@ virStoragePoolObjListExport(virConnectPtr conn, =20 virObjectRWLockRead(poolobjs); =20 - if (pools && VIR_ALLOC_N(data.pools, virHashSize(poolobjs->objs) + 1) = < 0) - goto error; + if (pools && VIR_ALLOC_N(data.pools, virHashSize(poolobjs->objs) + 1) = < 0) { + virObjectRWUnlock(poolobjs); + return -1; + } =20 virHashForEach(poolobjs->objs, virStoragePoolObjListExportCallback, &d= ata); virObjectRWUnlock(poolobjs); --=20 2.25.3