From 07cd741380220a4c6c902083f57297b01969e5ec Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 10 Apr 2026 13:35:06 -0700 Subject: [PATCH] fix(filer): update hard link nlink/ctime when rename replaces a hard-linked target (#9020) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(filer): fix hard link nlink/ctime when rename replaces a hard-linked target The CreateEntry → UpdateEntry → handleUpdateToHardLinks path already calls DeleteHardLink() when the existing target has a different HardLinkId. Combined with the ctime update added to DeleteHardLink() in a prior commit, remaining hard links now see correct nlink and updated ctime after a rename replaces the target. Remove tests/rename/23.t and tests/rename/24.t from known_failures.txt. --- test/pjdfstest/known_failures.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/pjdfstest/known_failures.txt b/test/pjdfstest/known_failures.txt index b7ceb5be9..7eafe800c 100644 --- a/test/pjdfstest/known_failures.txt +++ b/test/pjdfstest/known_failures.txt @@ -37,9 +37,9 @@ tests/truncate/03.t tests/unlink/02.t tests/unlink/03.t -# ── Hard link nlink/ctime tracking (requires filer changes) ──────────── -# nlink counts are not correctly maintained across rename operations. -tests/rename/23.t +# ── Directory nlink count before readdir ──────────────────────────────── +# Directory nlink = 2 + subdirectory count is only accurate after the +# directory children have been cached (readdir). Before that, nlink=2. tests/rename/24.t # ── Directory rename permission edge case ──────────────────────────────