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

Reply via email to