From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: Re: [PATCH] fix race condition between libvirtd event handling and libxl fd deregister Date: Mon, 10 Dec 2012 10:37:47 +0000 Message-ID: <20677.47995.298291.120095@mariner.uk.xensource.com> References: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz> <20661.3989.258191.396175@mariner.uk.xensource.com> <1354101923.25834.16.camel@zakaz.uk.xensource.com> <20674.16214.934271.479230@mariner.uk.xensource.com> <1355134766.31710.119.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1355134766.31710.119.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: "jfehlig@suse.com" , "xen-devel@lists.xen.org" , Bamvor Jian Zhang List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [PATCH] fix race condition between libvirtd event handling and libxl fd deregister"): > I took Bamvor's most recent response to mean that a per-event lock was > already in place in libvirt and inferred that this was the reason why > the originally proposed one line fix worked for them. Perhaps I > misunderstood? Yes, I think that's what Bamvor meant but I don't think it's correct that such a lock eliminates the race. libvirt has to release that lock before making the callback (to follow the libxl locking rules which are necessary to avoid deadlock). I'm not surprised that the original patch makes Bamvor's symptoms go away. Bamvor had one of the possible races (the fd-related one) but not the other. Ian.