From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: [xen-unstable test] 13461: regressions - FAIL Date: Thu, 5 Jul 2012 11:57:36 +0100 Message-ID: <20120705105736.GH13884@redhat.com> References: <1341467373.14447.9.camel@dagon.hellion.org.uk> <20120705092834.GE13884@redhat.com> <20469.28420.49684.132247@mariner.uk.xensource.com> <20120705104611.GG13884@redhat.com> <20469.29270.801506.115753@mariner.uk.xensource.com> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20469.29270.801506.115753@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 , Ian Campbell List-Id: xen-devel@lists.xenproject.org On Thu, Jul 05, 2012 at 11:54:14AM +0100, Ian Jackson wrote: > Daniel P. Berrange writes ("Re: [Xen-devel] [xen-unstable test] 13461: regressions - FAIL"): > > On Thu, Jul 05, 2012 at 11:40:04AM +0100, Ian Jackson wrote: > > > release_lock() > > > { > > > _setlockfd $1 > > > - flock -u $_lockfd > > > + rm "$_lockfile" > > > > I think you still want the 'flock' line here, but have it after the > > 'rm' line. Otherwise you leave the $_lockfd filehandle open. Yes, > > I know the calling script will probably just exit, but it doesn't > > hurt to be careful here. > > flock -u won't close the fd. If that's what you want then we would > have to do so explicitly. > > But, in the meantime the old lockfile exists and is pointlessly > flocked but is unlinked, which is harmless apart from being a slight > resource leak. > > Note that anyone who inherits a the fd from the hotplug script will > end up keeping the file in existence, so closing it here (with or > without unlocking it) may not do any good. And if there are no such > children with a copy of the fd then when the hotplug script dies or > exits the stale lockfile will be reaped by the kernel. > > So I think it's fine as it is. Ok, agreed. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|