From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHwZV-0005dS-5a for qemu-devel@nongnu.org; Tue, 08 Dec 2009 04:41:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHwZQ-0005Xr-2W for qemu-devel@nongnu.org; Tue, 08 Dec 2009 04:41:28 -0500 Received: from [199.232.76.173] (port=43168 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHwZP-0005Xg-VD for qemu-devel@nongnu.org; Tue, 08 Dec 2009 04:41:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:63899) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHwZP-0000bQ-G0 for qemu-devel@nongnu.org; Tue, 08 Dec 2009 04:41:23 -0500 Message-ID: <4B1E1EFF.5010608@redhat.com> Date: Tue, 08 Dec 2009 10:40:15 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Disk image shared and exclusive locks. References: <4B1A9C9F.5040705@codemonkey.ws> <4B1A9E83.2050103@redhat.com> <4B1A9F8C.3010106@codemonkey.ws> <20091207103128.GA26970@shareable.org> <20091207104517.GJ24530@redhat.com> <20091207111953.GA29980@shareable.org> <20091207113014.GK24530@redhat.com> <4B1D0699.4070402@codemonkey.ws> <20091207140132.GN24530@redhat.com> <4B1D0E17.7040507@codemonkey.ws> <20091207142814.GQ24530@redhat.com> <4B1D16DA.6040405@codemonkey.ws> In-Reply-To: <4B1D16DA.6040405@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Avi Kivity , "Richard W.M. Jones" , qemu-devel@nongnu.org Am 07.12.2009 15:53, schrieb Anthony Liguori: > Daniel P. Berrange wrote: >> It is safe if you assume that no one else has tried to modify the disk >> since you opened it, otherwise you'd be commiting changes against a >> base state which no longer exists. > > 1) first user opens cow1.qcow, acquires F_WRLCK > 2) first user opens base.qcow, acquires F_RDLCK > 3) second user opens cow2.qcow, acquires F_WRLCK > 4) second user opens base.qcow, acquires F_RDLCK > > 5) second user attempts to commit cow2.qcow to base.qcow This is broken regardless of locking (except for very... special use that I don't want to even think about, I'd call it criminal). Better don't commit to a backing file that is used by other COW images. Kevin