qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Disk image shared and exclusive locks.


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] Disk image shared and exclusive locks.
Date: Mon, 07 Dec 2009 08:15:51 -0600
User-agent: Thunderbird 2.0.0.23 (X11/20090825)

Daniel P. Berrange wrote:
Better to stick with on/off. That gives much easier to understand semantics.

The 3rd invocation is not changing the backing file, so it is not causing
data corruption on the master file. Sure the 3rd OS instance will probably
crash & get confused because its backing file is changing under its feet
but as long as 'commit' isn't used, it is still safe.

The 3rd instance is getting data corruption. The corruption is transient because we're using -snapshot but if you change the scenario to use a persistent cow overlay, then the corruption is permanent.

The semantics of shared/exclusive are non-obvious to anything but someone who understands the implementation.

'commit' should require that the disk have been locked in exclusive mode from the time
it started. It is not safe to merely let it upgrade the lock from
shared to exclusive at time of committing because of this exact scenario.
I don't understand why it isn't safe to temporarily acquire a write lock with commit. Can you give an example of how it would cause corruption?

Regards,

Anthony Liguori

Daniel





reply via email to

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