[PATCH] New option "mangled names = illegal"

Jeremy Allison jra at samba.org
Mon Jan 9 18:05:58 UTC 2017


On Mon, Jan 09, 2017 at 08:39:27AM -0800, Jeremy Allison wrote:
> On Mon, Jan 09, 2017 at 10:10:08AM +0100, Ralph Böhme wrote:
> > Hi Jeremy,
> > 
> > On Thu, Dec 15, 2016 at 03:25:54PM -0800, Jeremy Allison wrote:
> > > On Thu, Dec 15, 2016 at 01:28:00PM +0100, Ralph Böhme wrote:
> > > > Hi!
> > > > 
> > > > This one seemed obvious to me, I must be missing something. :)
> > > > 
> > > > With "mangled names = yes" we create mangled names for
> > > > 
> > > > 1) any name that contains illegal NTFS characters
> > > > 2) any name that exceeds 8.3 length limits
> > > > 
> > > > In case of 2 the mangled name is put into the shortname buffer in find
> > > > responses. Modern clients don't use the shortname anymore, so having an
> > > > additional "mangled names" option that mangles only for case 1), but not 2)
> > > > would be useful and reduce load on the server.
> > > > 
> > > > Attached is a patch that implements such an option, I've called it "mangled
> > > > names = illegal".
> > > > 
> > > > A benchmark shows that it improves performance by more then 10% in corner cases
> > > > like a directory with 20k files with long names:
> > > > 
> > > > $ cd /path/share/dir
> > > > $ i=1; while [ $i -lt 20001 ] ; do echo longfilename$i; touch longfilename$i; ((i++)); done
> > > > 
> > > > "mangled named = yes"
> > > > =====================
> > > > 
> > > > $ time ./bin/smbclient -U slow%x -m smb3 //localhost/share -c "ls dir\*" > /dev/null
> > > > Domain=[SLOWSERVER] OS=[] Server=[]
> > > > 
> > > > real    0m0.402s
> > > > user    0m0.055s
> > > > sys     0m0.036s
> > > > 
> > > > "mangled named = illegal"
> > > > =========================
> > > > 
> > > > $ time ./bin/smbclient -U slow%x -m smb3 //localhost/share -c "ls dir\*" > /dev/null
> > > > Domain=[SLOWSERVER] OS=[] Server=[]
> > > > 
> > > > real    0m0.352s
> > > > user    0m0.063s
> > > > sys     0m0.031s
> > > > 
> > > > What do you think?
> > > 
> > > I *really* like this. Will try and get time to review tomorrow !
> > 
> > did you get a change to look at this one?
> 
> Forgot it over Christmas, thanks for reminding me !

OK, rb+ and pushed !

Now, for 4.6.x and above, can we make this the
default ? It makes sense to me...

Jeremy.



More information about the samba-technical mailing list