From: Ian Campbell Subject: Re: [PATCH] hotplug/Linux: close lockfd after lock attempt Date: Thu, 18 Oct 2012 09:35:21 +0100 Message-ID: <1350549321.28188.44.camel@dagon.hellion.org.uk> References: <5aa14d5afe6b1f35b230.1350143968@probook.site> <20121013223558.GA19665@aepfle.de> <1350288065.14440.5.camel@dagon.hellion.org.uk> <20121015084252.GA27650@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20121015084252.GA27650@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Mon, 2012-10-15 at 09:42 +0100, Olaf Hering wrote: > On Mon, Oct 15, Ian Campbell wrote: > > > On Sat, 2012-10-13 at 23:35 +0100, Olaf Hering wrote: > > > On Sat, Oct 13, Olaf Hering wrote: > > > > > > > hotplug/Linux: close lockfd after lock attempt > > > > > > > > When a HVM guest is shutdown some of the 'remove' events can not claim > > > > the lock for some reason. Instead they try to grab the lock in a busy > > > > loop, until udev reaps the xen-hotplug-cleanup helper. > > > > After analyzing the resulting logfile its not obvious what the cause is. > > > > The only explanation is that bash (?) gets confused if the same lockfd > > > > is opened again and again. Closing it in each iteration seem to fix the > > > > issue. > > > > > > Can be reproduced with this testcase on sles11sp2, not on openSuSE 11.4: > > > > So this is a bash bug? Have you reported it against bash? > > It does not happen with a newer bash: bash 3.2 from sles11sp2 fails, > bash 4.1 from openSuSE 11.4 works. I added a comment: # Some versions of bash appear to be buggy if the same # $_lockfile is opened repeatedly. Close the current fd here. and reference to the bash version in the commit message. acked + applied. Thanks. > > Olaf