From nobody Mon Apr 29 09:46:53 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=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1527176595825807.0837259738846; Thu, 24 May 2018 08:43:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0DD1430C0EB9; Thu, 24 May 2018 15:43:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3A7312008255; Thu, 24 May 2018 15:43:12 +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 1B15618033EE; Thu, 24 May 2018 15:43:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4OFh91m028040 for ; Thu, 24 May 2018 11:43:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2C0CC308BDA3; Thu, 24 May 2018 15:43:09 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-137.phx2.redhat.com [10.3.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id E19E7308BDA1 for ; Thu, 24 May 2018 15:43:06 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Thu, 24 May 2018 11:43:04 -0400 Message-Id: <20180524154304.7907-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] disk: Allow settling to occur after reading partitions 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 24 May 2018 15:43:13 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1400475 In order to avoid a possible error as a result of kernel interactions with the partition helper, let's use virWaitForDevices to force things to settle down before attempting to open and read the partition. This is related to https://bugzilla.redhat.com/show_bug.cgi?id=3D1264719. Signed-off-by: John Ferlan --- NB: This also resolves issues seen while testing the patch with using pool-refresh "frequently" on the disk pool. Perhaps the timing of things has changed enough that it'd be see more often now. At least with the f26 test system I used. BTW: The other option proposed long ago, but rejected was adding a timeout loop. I've also run the python script from the other bz with 100% success. src/storage/storage_backend_disk.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backe= nd_disk.c index 7b4549c34d..2e3d1e04a4 100644 --- a/src/storage/storage_backend_disk.c +++ b/src/storage/storage_backend_disk.c @@ -183,7 +183,16 @@ virStorageBackendDiskMakeDataVol(virStoragePoolObjPtr = pool, * after an extended partition is created an open on the extended * partition will fail, so pass the NOERROR flag and only error if a * -1 was returned indicating some other error than an open error. + * + * NB: A small window exists in some cases where the just created + * partition disappears, but then reappears. Since we were given + * vol->target.path from parthelper, let's just be sure that any + * kernel magic that occurs as a result of parthelper doesn't cause + * us to fail with some sort of ENOENT failure since that would be + * quite "unexpected". So rather than just fail, let's use the + * virWaitForDevices to ensure everything has settled properly. */ + virWaitForDevices(); if (vol->source.partType =3D=3D VIR_STORAGE_VOL_DISK_TYPE_EXTENDED) { if (virStorageBackendUpdateVolInfo(vol, false, VIR_STORAGE_VOL_OPEN_DEFAULT | --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list