fix(filer): do not abort entry deletion when hard link cleanup fails (#9022)

When unlinking a hard-linked file, DeleteOneEntry and DeleteEntry both
called DeleteHardLink before removing the directory entry from the
store. If DeleteHardLink returned an error (e.g. KV storage issue,
decode failure), the function returned early without deleting the
directory entry itself. This left a stale entry in the filer store,
causing subsequent rmdir to fail with ENOTEMPTY.

Change both functions to log the hard link cleanup error and continue
to delete the directory entry regardless. This ensures the parent
directory can always be removed after all its children are unlinked.

Remove tests/unlink/14.t from the pjdfstest known failures list since
this fix addresses the root cause.
This commit is contained in:
Chris Lu authored and GitHub committed 2026-04-10 13:59:58 -07:00
1 parent 07cd741380
commit 2a7ec8d033
2 files changed
+13 -6

No files matched your search

+2 -2
View File
@@ -48,7 +48,7 @@ tests/rename/24.t
tests/rename/21.t
# ── rmdir after hard link unlink ───────────────────────────────────────
# The filer may still report a directory as non-empty after all hard-linked
# entries have been unlinked.
# Making DeleteHardLink errors non-fatal prevents the entry from blocking
# rmdir in most cases, but the test still has 1 subtest that fails.
tests/unlink/14.t