On Fri Jan 31 18:17:27 2025 +0000, Jinoh Kang wrote:
I've noticed that this MR fails on an ext4 casefold filesystem:
file.c:2085: Test failed: MoveFile failed to change casing on same file: got Remove Me file.c:2130: Test failed: MoveFile failed to change casing on same directory: got Remove me
I'd place blame on rename(2) itself ignoring case renames if casefold is enabled. Does SteamOS use case-insensitive filesystem? In that case, does Proton take any different approach?
Interesting. That seems like a different problem, it won't even reach the `rename`. In fact, if you have say a file `ABC` and attempt to rename to `abc`, `nt_to_unix_file_name` will return /path/to/abc (yes, lowercase) because it won't look it up manually component-by-component, as the direct lookup is valid (due to case folding).
This causes `different_case` in the patch to be 0, since it's the same case (both are `abc`), and the file has the same inode because it's the same file, so it thinks it's a no-op, hence this returns early here:
```c if (!different_case) { free( name ); return; } ``` This probably needs something akin to !6855, I'm not sure. I think at this point, we should try to get that one in first, so we can go from there and see how we can fix this case, otherwise they'd keep ending up conflicting each other.