Case-insensitive filesystem lookups
Case-insensitive filesystem lookups
Posted May 23, 2018 18:09 UTC (Wed) by saffroy (guest, #43999)In reply to: Case-insensitive filesystem lookups by EdwardConnolly
Parent article: Case-insensitive filesystem lookups
The most commonly used network filesystem in the Windows and Mac worlds is now SMB (Apple deprecated its own AFP file service a few years ago), and these environments (applications, tools) expect file names to be case insensitive, that is: in any given directory, "foo" and "FOO" and "Foo" must resolve to the same file (if they resolve to any file at all). Another expectation is that the filesystem be case preserving: if the application creates file "Foo", it is expected to show up as "Foo" (and not "foo" or "FOO") in a directory listing.
But of course, in Unix tradition, a Linux filesystem is case sensitive.
To meet these expectations, a Linux-based SMB server (Samba) running on a case-sensitive Linux filesystem needs to do extra work which can badly impact performance. For example, when creating "Foo", Samba needs to check if *any* variant of "[fF][oO][oO]" already exists; typically, this is done by scanning the entire directory, which becomes horribly expensive when that directory is large (think thousands of entries). This is pretty bad. And some SMB clients (such as the MacOS Finder) make things worse by their specific quirks (Appledouble files come to mind).
If the underlying filesystem were case insensitive (and case preserving), Samba would have much less work to do in many cases. And actually, some filesystem vendors (eg. IBM for GPFS) provide Samba modules that reduce the impact when possible: the filesystem can be made case-sensitive (entirely, or per directory), and/or its Samba module can provide an optimized case-insensitive lookup method that bypasses the VFS.
