copies of these files are getting slower and slower

Richard Sharpe realrichardsharpe at
Wed Apr 26 14:37:06 UTC 2017

On Wed, Apr 26, 2017 at 1:18 AM, Liuxuan via samba-technical
<samba-technical at> wrote:
> Hi,everyone:
> Recently,I meet a performance problem ,when I use Samba 4.2.11 to copy files from windows to linux. copies of these
> files are getting slower and slower quickly. But when I set the “case sensitive = yes” in smb.conf, it works very well.
> Can anyone help me? How should I deal with this problem when I use case “sensitive = yes”?
> The protocol is SMB2_10 and file size is 105KB.

This is a well known issue. Since Samba is trying to provide the same
semantics as Windows, eg Case Preserving, Case Insensitive, when you
try to create a file, it:

1. stat's the name as presented to check for existence, but if that fails,
2. It has to search the directory for case-equivalent names.

Only if 2 fails can it go ahead and create a new problem.

This is an O(N^2) problem.

By telling Samba that the file system is case sensitive you skip step
2. However, there be dragons unless you actually have a file system,
like XFS or ZFS that can do case-insensitive lookups ...

Richard Sharpe

More information about the samba-technical mailing list