[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Jan 26 10:25:08 MST 2011


On Wed, Jan 26, 2011 at 05:54:35PM +0100, Volker Lendecke wrote:
> On Wed, Jan 26, 2011 at 08:30:11AM -0800, Jeremy Allison wrote:
> > We use smb_filename in many places where we're manipulating
> > paths, not just opening files. The hash is a property of an
> > *open* file, not a pathname.
> 
> Well, if I read the code right then you hash the file name,
> not anything else. So I'd call this a property of the file
> name and nothing else...

I know it looks that way, but it really isn't. We
don't want to be calculating that hash every time
we manipulate a component of a pathname (which we
do quite often with smb_filename).

Aha ! I know what should convince you - it's calculated
from the connect path + the filename (it needs to be the
full path on disk). The connect path is a property of the
tcon. This should at least show you it's not just a filename
property.

> Yes, I was worried by the trans2.c uses. I am worried that
> more such uses might crop up in the future and we don't get
> the hashing right. Can we build in some mechanism that we
> are forced to get this right?

Don't know how without moving to handle based calls for
everything.

> Another confusing thing is the get_file_infos call giving 0
> as a hash in smb2_create. It is clear that this is only used
> when we need the delete_on_close, but this is a dependency
> that is not really obvious. It would be nice if we could
> decouple this somehow.

Maybe make that argument into a struct and pass NULL if
neither are used ?

Jeremy.


More information about the samba-technical mailing list