[PATCH] vfs_gpfs: Retry getacl with DAC capability if necessary

Jeremy Allison jra at samba.org
Mon Aug 1 16:16:24 UTC 2016


On Sun, Jul 24, 2016 at 02:06:15PM -0700, Christof Schmitt wrote:
> On Fri, Jul 22, 2016 at 09:30:55AM -0700, Jeremy Allison wrote:
> > On Thu, Jul 21, 2016 at 09:52:34PM -0700, Christof Schmitt wrote:
> > > 
> > > Yes. There is a retry loop for the case that the ACL does not fit into
> > > the allocaged buffer:
> > > 
> > >  if ((ret != 0) && (errno == ENOSPC)) {
> > > ...
> > >                 goto again;
> > > 
> > > The logic is that if capabilities are required, and the initial buffer
> > > was too small, then the code should only do one additional retry with
> > > the larger buffer and the capability.
> > > 
> > > At some point, i would like to refactor the loop for ENOSPC into a
> > > simple retry, but that is independent of fallback to use the capability.
> > > 
> > > > > +	} else {
> > > > > +		ret = gpfswrap_getacl(discard_const_p(char, fname),
> > > > > +				      flags, aclbuf);
> > > > > +		if ((ret != 0) && (errno == EACCES)) {
> > > > > +			DBG_DEBUG("Retry with DAC capability for %s\n", fname);
> > > > > +			use_capability = true;
> > > > > +			ret = gpfs_getacl_with_capability(fname, flags, aclbuf);
> > > > > +		}
> > > > > +	}
> > > > > +
> > > > 
> > > > Looks like the above block (without the else {...}) is all
> > > > you need for this.
> > > 
> > > The "else" case here is for the initial attempt. We do not want the
> > > overhead of acquiring the capability for every attempt to read the ACL,
> > > only when the READ_ACL is missing and the initial attempt results in
> > > EACCESS.
> > 
> > Doh - missed the "goto again" part :-).
> > 
> > Thanks for the explaination.
> 
> No problem.
> > 
> 
> > LGTM - pushed !
> > 
> 
> For some reason, the autobuild did not go through. I just pushed the
> patch in a separate autobuild.

Thanks for that, was out for a week on vacation and wasn't
checking email.



More information about the samba-technical mailing list