qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: qcow2 api not secured by mutex lock


From: Max Reitz
Subject: Re: qcow2 api not secured by mutex lock
Date: Thu, 19 Dec 2019 11:35:03 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

On 19.12.19 11:02, Kevin Wolf wrote:
> Am 18.12.2019 um 11:28 hat Vladimir Sementsov-Ogievskiy geschrieben:

[...]

>> qcow2_write_snapshots actually called unlocked from
>> qcow2_check_fix_snapshot_table.. It seems unsafe.
> 
> This is curious, I'm not sure why you would drop the lock there. Max?
> 
> bdrv_flush() calls would have to replaced with qcow2_write_caches() to
> avoid a deadlock, but otherwise I don't see why we would want to drop
> the lock.
> 
> Of course, this should only be called from qemu-img check, so in
> practice it's probably not a bug.

Maybe I should have read all of this before replying...  Is
qcow2_write_caches() all that we want?  I mean, bdrv_flush() also
flushes the children (well, at least the file child right now).

OTOH qcow2_write_snapshots() probably does not need to take care of
actually flushing @bs, does it?

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]