On Mon Feb 24 15:28:37 2025 +0000, Jinoh Kang wrote:
In case of directories, I think it's safe to do the rename-to-temp-and-rename-to-dest dance.
True, and on second thought, can even skip the directory checks since directories can't be hardlinked anyway. If it goes past the strcmp that checks if same dentry, it's guaranteed to be casefold filesystem anyway, so in all other cases it would exit early (which is good because the rename-to-temporary isn't atomic, so in other cases it shouldn't do anything).