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

Re: [PATCH] scripts: don't rely on "stat -" support


  • To: Jason Andryuk <jandryuk@xxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxx>
  • Date: Thu, 25 Jun 2020 17:35:40 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Thu, 25 Jun 2020 16:35:58 +0000
  • Ironport-sdr: e9fzRMj/o4Fb/tv2uOXovEqPKGrjRfdWcLhgSbiRFHtGGH/ZpgjD2h0syg+5T4IwGfrWO9LXhy BsdxTTO0L+3aLycimaihhQOkNjfZXcN37QIYG2cwNsAaY0Oc0YMNuSFA4S7zWb04hSd76vVc2z Y5LmI8FDDncYhMroruH8EHUeCGYgIKREbzEbOBI2gA50riEzaLXPpz0/481iWzZfw14IwfiIJ+ T+U9tPsQRGT/z/PT0IJ0qvLoasBQZ0wyuXGyI8LbIu3mI29a5QcOmAUBb0lXdvDnk5qXZ4ySvB lIM=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Jason Andryuk writes ("Re: [PATCH] scripts: don't rely on "stat -" support"):
> On Thu, Jun 25, 2020 at 11:47 AM Jan Beulich <jbeulich@xxxxxxxx> wrote:
> >
> > On 25.06.2020 17:45, Ian Jackson wrote:
> > > Jan Beulich writes ("[PATCH] scripts: don't rely on "stat -" support"):
> > >> While commit b72682c602b8 ("scripts: Use stat to check lock claim")
> > >> validly indicates that stat has gained support for the special "-"
> > >> command line option in 2009, we should still try to avoid breaking being
> > >> able to run on even older distros. As it has been determined, contary to
> > >> the comment in the script using /dev/stdin (/proc/self/fd/$_lockfd) is
> > >> fine here, as Linux specially treats these /proc inodes.
> > >>
> > >> Suggested-by: Ian Jackson <ian.jackson@xxxxxxxxxx>
> > >> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> > >
> > > Thanks.
> > >
> > > The only code change here is this:
> > >
> > >> --- a/tools/hotplug/Linux/locking.sh
> > >> +++ b/tools/hotplug/Linux/locking.sh
> > >> @@ -45,18 +45,14 @@ claim_lock()
> > >> -        if stat=$( stat -L -c '%D.%i' - $_lockfile 0<&$_lockfd 
> > >> 2>/dev/null )
> > >> +        if stat=$( stat -L -c '%D.%i' /dev/stdin $_lockfile 0<&$_lockfd 
> > >> 2>/dev/null )
> > >
> > > Reviewed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> > >
> > > Has anyone executed this ?
> >
> > I have, of course, to confirm this fixes my issue. But I'm not sure
> > that's what you've meant to ask - you may have wanted assurance
> > that someone else has also tried it.
> 
> Tested-by: Jason Andryuk <jandryuk@xxxxxxxxx>
> Reviewed-by: Jason Andryuk <jandryuk@xxxxxxxxx>

:-).

Thanks,
Ian.



 


Rackspace

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