Case-insensitive ext4
Case-insensitive ext4
Posted Mar 27, 2019 19:25 UTC (Wed) by Cyberax (✭ supporter ✭, #52523)In reply to: Case-insensitive ext4 by Karellen
Parent article: Case-insensitive ext4
Posted Mar 27, 2019 20:02 UTC (Wed)
by rweikusat2 (subscriber, #117920)
[Link] (15 responses)
Posted Mar 27, 2019 20:05 UTC (Wed)
by Cyberax (✭ supporter ✭, #52523)
[Link] (11 responses)
Posted Mar 27, 2019 21:17 UTC (Wed)
by rweikusat2 (subscriber, #117920)
[Link] (8 responses)
Posted Mar 27, 2019 21:26 UTC (Wed)
by Cyberax (✭ supporter ✭, #52523)
[Link]
I've seen this firsthand - I'm using a Linux server for TimeMachine backups for Mac OS X. TimeMachine is braindead - it creates hundreds of thousands files in the same directory. With the default settings Samba slowed down to a crawl.
Fortunately, TimeMachine doesn't care about file name cases. So by following steps from here: https://wiki.samba.org/index.php/Performance_Tuning I was able to speed up backups by something like 10x. This is not insignificant and it would be nice for Linux to handle similar use-cases natively.
Posted Mar 28, 2019 0:50 UTC (Thu)
by rahulsundaram (subscriber, #21946)
[Link] (6 responses)
Have you talked to Samba developers and asked them if they are happy with the current performance or would like to see better support from the kernel? If you haven't I would encourage you to do that or talk to enterprises supporting Samba or even large customers. I think you will find that perspectives useful to add to your opinions.
Posted Mar 28, 2019 16:10 UTC (Thu)
by rweikusat2 (subscriber, #117920)
[Link] (5 responses)
Posted Mar 28, 2019 18:36 UTC (Thu)
by Cyberax (✭ supporter ✭, #52523)
[Link] (3 responses)
Posted Mar 29, 2019 3:03 UTC (Fri)
by pabs (subscriber, #43278)
[Link] (2 responses)
Posted Mar 29, 2019 4:21 UTC (Fri)
by Cyberax (✭ supporter ✭, #52523)
[Link] (1 responses)
fanotify is better, but it also can drop events from time to time under high load.
Posted Oct 4, 2023 18:51 UTC (Wed)
by calumapplepie (guest, #143655)
[Link]
Posted Mar 29, 2019 22:55 UTC (Fri)
by jra (subscriber, #55261)
[Link]
Unfortunately it isn't enough. Cache misses are the problem. If the SMB client sends a filename "foo" and it isn't in the directory, we don't know if it doesn't exist, or exists under another case (e.g. as "Foo"). In that case we need to scan the directory. This gets really expensive, really quickly.
We don't negatively cache as we're often used to export filesystems that local processes are also modifying.
I've been wanting a case-insensitive filesystem lookup option in Linux for a long time (I think ZFS and XFS already have it, however flawed).
Posted Mar 28, 2019 7:28 UTC (Thu)
by patrakov (subscriber, #97174)
[Link] (1 responses)
Posted Mar 28, 2019 7:35 UTC (Thu)
by Cyberax (✭ supporter ✭, #52523)
[Link]
But this will break a ton of other software that wants to directly modify the disk files. It will also mean that Linux's VFS is inadequate for a fairly common use-case.
Posted Mar 27, 2019 20:17 UTC (Wed)
by mathstuf (subscriber, #69389)
[Link] (2 responses)
Sorry for the snark, it's not in response to your comment in particular, but my mind coming up with all the Pandora's boxes this is threatening to open.
Posted Mar 27, 2019 21:11 UTC (Wed)
by rweikusat2 (subscriber, #117920)
[Link] (1 responses)
It's possible to implement case-insensitive open in user space without doing a second linear search through a directory for every open.
Posted Mar 27, 2019 21:19 UTC (Wed)
by Cyberax (✭ supporter ✭, #52523)
[Link]
There's also the problem of making sure that no duplicate files exist.
Posted Mar 29, 2019 9:16 UTC (Fri)
by Karellen (subscriber, #67644)
[Link] (2 responses)
How is a call to open() getting the filename to open? Either it's going to from an existing directory scan, in which case the capitalisation/normal form should already be correct, or it's going to be because a user has selected a file - in which case the shell/picker/whatever should be able to do that work already?
Where would calls to open() be getting these correctly named but incorrectly capitalised/normalised filenames from?
Posted Mar 29, 2019 9:20 UTC (Fri)
by Cyberax (✭ supporter ✭, #52523)
[Link]
You can try a happy case and just attempt an open() with the provided name. If it fails, you need to scan the directory to find a matching file with a different case.
And you can't really cache the negative result, patterns like "if !exists(fname) {creat(fname);}" are exceedingly common.
Posted Apr 4, 2019 17:09 UTC (Thu)
by Wol (subscriber, #4433)
[Link]
The user, maybe?
What about the use case where I type in a name in a picker, and it displays a bunch of matches?
Or what about the case where I typed in the name on the command line? Some of us still use a command line, you know ...
Cheers,
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
Nope. There is no way to maintain this cache with any sort of consistency guarantees. Linux filesystem change notifications are not up to it.
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
Case-insensitive ext4
You have an SMB request to open a file, with a file name. There's nothing else.
Case-insensitive ext4
Wol