From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sn4a8-0001M1-5j for qemu-devel@nongnu.org; Fri, 06 Jul 2012 05:12:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sn4a1-0003L5-VU for qemu-devel@nongnu.org; Fri, 06 Jul 2012 05:12:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sn4Y6-0002ik-Lc for qemu-devel@nongnu.org; Fri, 06 Jul 2012 05:12:01 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6699maN015243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 6 Jul 2012 05:09:58 -0400 Message-ID: <4FF6AAA1.3070907@redhat.com> Date: Fri, 06 Jul 2012 11:06:41 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1340390174-7493-1-git-send-email-coreyb@linux.vnet.ibm.com> <20120626091004.GA14451@redhat.com> <4FE9A0F0.2050809@redhat.com> <20120626175045.2c7011b3@doriath.home> <4FEA37A9.10707@linux.vnet.ibm.com> <4FEA3D9C.8080205@redhat.com> <4FF21A67.8010100@linux.vnet.ibm.com> <4FF31265.1000308@linux.vnet.ibm.com> <4FF316C9.5020100@redhat.com> <4FF31CFD.7030508@linux.vnet.ibm.com> <4FF325C8.4060401@redhat.com> <4FF3F806.7020307@redhat.com> <4FF5A331.9030108@linux.vnet.ibm.com> <4FF5A9D9.7080607@redhat.com> <4FF5C24E.9010008@linux.vnet.ibm.com> <4FF5C2BE.3070607@linux.vnet.ibm.com> In-Reply-To: <4FF5C2BE.3070607@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 0/7] file descriptor passing using pass-fd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Bryant Cc: aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, libvir-list@redhat.com, qemu-devel@nongnu.org, Luiz Capitulino , pbonzini@redhat.com, Eric Blake Am 05.07.2012 18:37, schrieb Corey Bryant: >>>>> There is one case I'm aware of where we need to be careful: Before >>>>> opening an image, qemu may probe the format. In this case, the image >>>>> gets opened twice, and the first close comes before the second open. >>>>> I'm >>>>> not entirely sure how hard it would be to get rid of that behaviour. >>>>> >>>>> If we can't get rid of it, we have a small window that the refcount >>>>> doesn't really cover, and if we weren't careful it would become racy. >>>>> This is why I mentioned earlier that maybe we need to defer the >>>>> refcount >>>>> decrease a bit. However, I can't see how the in-use flag would make a >>>>> difference there. If the refcount can't cover it, the in-use flag can't >>>>> either. >>>> >>>> Yeah this is a problem. Could we introduce another flag to cover this? >>> >>> Adding more refcounts or flags is not a problem, but it doesn't solve it >>> either. The hard question is when to set that flag. >>> >>> I believe it may be easier to just change the block layer so that it >>> opens files only once during bdrv_open(). > > Can this fix be delivered after the fd passing patch series? Sure, we can't fix everything at once. Kevin