소스 검색

Kernel/FileSystem: Remove FIXME about old/new path being the same

Added comment after confirming that Linux and OpenBSD implenment the
same behavior.
Taj Morton 2 년 전
부모
커밋
a91fc697bb
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      Kernel/FileSystem/VirtualFileSystem.cpp

+ 5 - 1
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()) {