stat_cache_lookup simplification

Jeremy Allison jra at samba.org
Sat Jul 7 00:17:33 GMT 2007


On Fri, Jul 06, 2007 at 11:00:17PM +0200, Volker Lendecke wrote:
> Hi, Jeremy!
> 
> Attached find a series of patches that attempt to simplify
> stat_cache_lookup a bit. I finally want to kill the pstrings
> here, so I need to understand that code. Attached also find
> the resulting function.

Thanks for that, it made the review much easier to do.
I couldn't have checked the logic with just the patch,
thanks.

> I think that with each step I did not change any logic at
> all, but this is so central that I don't want to check it in
> directly.

I agree - I think you've simplified it without changing
any of the logic - thanks a *lot* for this change.

> Questions:
> 
> At the end of the while(1) loop we check if chk_name is "",
> "." or "..". Why is that in the loop? I don't see how the
> rest of the loop can affect this decision.

You already answered that :-).

> The calculation of sizechange is not 100% reliable I think.
> If in a string two size change happen: One code point gains
> a byte, another one loses one. In this case the resulting
> size does not change, but if this happens between two path
> components we might corrupt the result.

Errr - yeah, probably. How would we detect this ? I
wouldn't consider that a showstopper for checking this
in though - +1 from me for 3.0 and 3.0.26.

Thanks,

	Jeremy.


More information about the samba-technical mailing list