As part of my GSoC project, me and my mentor have decided to extend support for renameat2 in the compat_linux. We have decided to enable support for 2 newer flags, namely RENAME_NOREPLACE and RENAME_EXCHANGE. There are 2 particular questions, on which we would like to gather communities insights:
1. To prevent TOCTOU attack and provide atomicity, most of the renameat code has been reimplemented in the compat layer. Is this an acceptable approach or are there some better alternatives? 2. RENAME_EXCHANGE requires atomic swap of filenames and the filetypes need not be the same. Can any of the existing VFS operations be used to do so? And if this should be done in VFS layer or any specific support is expected from the file system to implement this? Shivraj
