find_first2 lookup behaviour on Samba with a case Insensitive FS

David Disseldorp ddiss at
Thu May 29 03:55:16 GMT 2008


I've been testing Samba 3.2 on a Case Insensitive (CI) XFS filesystem[1]
with fs_capabilities set accordingly. Running into an interesting issue.

Test Case:
- map the CI XFS backed Samba share as z:
- open a cmd window
- z:
- mkdir lowercasedir

the prompt will then appear as z:\LOWERCASEDIR> rather than
z:\lowercasedir> as shown on a stock Samba (no CI filesys) or NTFS.

This is due to the name returned by a find_first2 SMB, which is obtained
via unix_convert() where:

  - a stat of any case variant will succeed on a CI filesys
    -> the same name is returned

  - a stat of case variant will fail on case sensitive filesys
    -> falls through to perform a directory scan
    -> if the file is found during the directory scan, the file name
       as it is stored on disk is returned

Aside from maybe confusing users, could this behaviour cause problems
for applications?

I'll post the CI XFS Samba patch after a cleanup and a few runs of
James's RAW-BENCH-LOOKUP test.

Cheers, Dave


More information about the samba-technical mailing list