On Mon Mar 17 21:26:00 2025 +0000, Gabriel Ivăncescu wrote:
I mean yeah, I didn't really like it, if we're going to do something against TOCTTOU, that fstatat seemed like needless complication since it doesn't *solve* it anyway. But your mkdir idea is great, I didn't even know it works on empty dirs to replace them. The new version should address all the issues, but if I understand correctly, on filesystems not supporting hardlinks (like FAT32), casefold rename to same file won't work correctly, right? I mean, it's not that I messed something up, or is it? (the latest version fails to rename casefold files to same name but different case in FAT32, even *if* in this case it's passed the correct case, so it's not affected by my other MR, but works fine for ext4)
I'm not sure what you meant, but your MR seems to work exactly what I'd expect on both vfat and ext4 (+F and -F).
Note that vfat and ext4-casefold have the same semantics when it comes to rename(2) into a different case i.e., rename("foo", "FOO") is a no-op.