From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Pau Monne Subject: Re: [xen-unstable test] 13461: regressions - FAIL Date: Thu, 5 Jul 2012 12:53:33 +0100 Message-ID: <4FF5803D.1050706@citrix.com> References: <1341467373.14447.9.camel@dagon.hellion.org.uk> <20120705092834.GE13884@redhat.com> <20469.28420.49684.132247@mariner.uk.xensource.com> <1341485867.16599.40.camel@zakaz.uk.xensource.com> <20469.30895.649674.304299@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20469.30895.649674.304299@mariner.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 Jackson Cc: "xen-devel@lists.xensource.com" , Zhigang Wang , "Daniel P. Berrange" , Ian Campbell List-Id: xen-devel@lists.xenproject.org Ian Jackson wrote: > Ian Campbell writes ("Re: [Xen-devel] [xen-unstable test] 13461: regressions - FAIL"): >>> + flock -x $_lockfd >>> + # We can't just stat /dev/stdin or /proc/self/fd/$_lockfd or >>> + # use bash's test -ef because those all go through what is >>> + # actually a synthetic symlink in /proc and we aren't >>> + # guaranteed that our stat(2) won't lose the race with an >>> + # rm(1) between reading the synthetic link and traversing the >>> + # file system to find the inum. Perl is very fast so use that. >>> + rightfile=$( perl -e ' >> Won't this need to become $(PERL) (or @PERL@ and some seddery at install >> time) for the benefit of BSD? > > This is in tools/hotplug/Linux. AFAICT at least some of the BSDs have > an fstat(1). BSD don't currently have any of this locking mechanism, which makes it vulnerable to races regarding hotplug scripts launch. I think libxl should be a better place to perform all this kind of locking, instead of the hotplug scripts, which are already polluted enough, but as far as I know we don't have any kind of inter-process locking mechanism right now?