[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/2] scripts: Use stat to check lock claim



Wei Liu writes ("Re: [PATCH 2/2] scripts: Use stat to check lock claim"):
> On Thu, Mar 12, 2020 at 10:54:17AM -0400, Jason Andryuk wrote:
> > Replace the perl locking check with stat(1).  Stat is able to fstat
> > stdin (file descriptor 0) when passed '-' as an argument.  This is now
> > used to check $_lockfd.  stat(1) support for '-' was introduced to
> > coreutils in 2009.
> > 
> > After A releases its lock, script B will return from flock and execute
> > stat.  Since the lockfile has been removed by A, stat prints an error to
> > stderr and exits non-zero.  Redirect stderr to /dev/null to avoid
> > filling /var/log/xen/xen-hotplug.log with "No such file or directory"
> > messages.
> > 
> > Placing the stat call inside the "if" condition ensures we only check
> > the stat output when the command completed successfully.
> > 
> > This change removes the only runtime dependency of the xen toolstack on
> > perl.
> > 
> > Suggested-by: Ian Jackson <ian.jackson@xxxxxxxxxx>
> > Signed-off-by: Jason Andryuk <jandryuk@xxxxxxxxx>
> 
> Ian, ping?
> 
> I already applied patch 1. This patch looks to be good as well.

Sorry.  Yes.

Reviewed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.