[PATCH] avoid calling casefold_internal if the dn is already casefolded

simo idra at samba.org
Wed Dec 12 07:52:22 MST 2012


On Wed, 2012-12-12 at 22:26 +1100, Andrew Bartlett wrote:
> On Tue, 2012-12-11 at 22:23 -0800, Matthieu Patou wrote:
> > Hello,
> > 
> > Can someone review this patch ?
> > 
> > It comes from analysis of indexed ldb_search with scope = one or subtree.
> > For each entries in the index we will compare the dn in the index to dn 
> > specified as base for the search. And we keep casefolding the later one 
> > which is useless and costly.
> > 
> > With a hundreds of entries in the index the cost of cost folding is 
> > starting to be one of the most important one. With this patch we can 
> > avoid useless calls.
> 
> Did this really help?  I can't see how this is any different to the
> dn->valid_case check we already do in ldb_dn_casefold_internal().
> 
> Additionally, the reason that dn->valid_case needs to be checked is that
> if the DN is changed, the casefolded version may not be valid, and may
> need to be regenerated.  (ie, there is a correctness issue here as
> well). 

Concur,
I was going to make the same reply.

NACK.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>



More information about the samba-technical mailing list