diff options
author | Taj Morton <tajmorton@gmail.com> | 2022-12-30 22:44:45 -0800 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2023-01-04 09:02:13 +0000 |
commit | a91fc697bbd019dd2e9ae9c261c3acaf7fda616b (patch) | |
tree | 46befcf29834858cac89f2d96b07983472f4fe1b /Kernel/FileSystem | |
parent | d57e9b53a03bf944b6ffdec5fc3bae4695dc5876 (diff) | |
download | serenity-a91fc697bbd019dd2e9ae9c261c3acaf7fda616b.zip |
Kernel/FileSystem: Remove FIXME about old/new path being the same
Added comment after confirming that Linux and OpenBSD implenment the
same behavior.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r-- | Kernel/FileSystem/VirtualFileSystem.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp index fb45580216..509cd6974f 100644 --- a/Kernel/FileSystem/VirtualFileSystem.cpp +++ b/Kernel/FileSystem/VirtualFileSystem.cpp @@ -648,7 +648,11 @@ ErrorOr<void> VirtualFileSystem::rename(Credentials const& credentials, Custody& if (!new_custody_or_error.is_error()) { auto& new_custody = *new_custody_or_error.value(); auto& new_inode = new_custody.inode(); - // FIXME: Is this really correct? Check what other systems do. + // When the source/dest inodes are the same (in other words, + // when `old_path` and `new_path` are the same), perform a no-op + // and return success. + // Linux (`vfs_rename()`) and OpenBSD (`dorenameat()`) appear to have + // this same no-op behavior. if (&new_inode == &old_inode) return {}; if (new_parent_inode.metadata().is_sticky()) { |