Hi Thiemo, Thank you for comments. You probably right about the "child" -> "is_parent" renaming, But the "parent_open" variable (I know, the name is not the best. you can rename it) is not a duplicate of the "is_parent".
The only one reason for existence of "parent_open" it's set/reset the "is_parent". I think we can't use the "is_parent" instead, because we need to know at every moment if it's a "parent" or "leaf" image. I mean, if we'll use "is_parent" instead of "parent_open": + s->is_parent = 1; + if (bdrv_open(s->hd->backing_hd, parent_img_name, BDRV_O_RDONLY) < 0) goto failure; + s->is_parent = 0; We'll reset it after the file opening. It's mean, later during the "get_cluster_offset()" we'll not be able to know if it's a "parent" or "leaf" image. So, I attach a new patch with you comments. Regards, Igor Lvovsky -----Original Message----- From: Thiemo Seufer [mailto:[EMAIL PROTECTED] Sent: Sunday, May 20, 2007 12:42 AM To: Igor Lvovsky Cc: qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH] Fix a race condition and non-leaf images growing in VMDK chains. Thiemo Seufer wrote: > Igor Lvovsky wrote: > > > > Hi, > > The bug was in my last patch. > > This is a new one. > > I'll very appreciate any comments. > > Appended is a variant which gets rid of the confusing "child" variable > which means "is_parent", and the duplicate of it (parent_open). > > There was also an uninitialized variable "tmp" which was stored as > offset in m_data. > > I quite possibly missed some bits which broke the patch, please test if > it still works for you. Next try, this time with the latest version of the patch. Thiemo
block-vmdk-patch.diff
Description: block-vmdk-patch.diff