[PATCH] New option "mangled names = illegal"

Ralph Böhme slow at samba.org
Mon Jan 9 09:10:08 UTC 2017


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?

Cheerio!
-slow



More information about the samba-technical mailing list