fix(slayerfs): align redis rename/unlink semantics and fuse rename behavior#596
fix(slayerfs): align redis rename/unlink semantics and fuse rename behavior#596KBrynhild wants to merge 1 commit intork8s-dev:mainfrom
Conversation
…havior Signed-off-by: KBrynhild <K_Bohemian@outlook.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ed3faebb3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // POSIX allows same-path rename as a no-op. | ||
| if adapter::is_same_rename(parent, name.as_ref(), new_parent, new_name.as_ref()) { | ||
| return Ok(()); |
There was a problem hiding this comment.
Check source existence before same-path rename fast path
Returning Ok(()) for parent/new_parent + name/new_name equality before the source lookup skips the child_of/stat_ino validation below, so a same-path rename can succeed even when the source entry has already disappeared (e.g., under concurrent unlink/rename races). POSIX no-op semantics only apply when the source exists; otherwise callers should see ENOENT, and silently succeeding here can mask real failures.
Useful? React with 👍 / 👎.
本 PR 针对 Redis 元数据后端与 FUSE/VFS 语义不一致的问题进行修复,重点覆盖以下风险:
### 主要改动
在 Redis Lua rename 脚本中实现目标替换与源移动的单次原子流程。
覆盖式重命名时在脚本内完成目标类型校验、目录非空判断、目标删除与源项迁移,避免 VFS 先删后改名导致的竞态窗口。
针对硬链接场景同步维护 link_parents 与 nlink 变化。
目录项不存在时返回 not_found。
节点不存在时返回 node_not_found。
节点损坏时返回 corrupt_node。
Rust 层按上述错误进行显式映射,不再将异常状态统一吞为成功删除。
移除未使用且仅占位的 adapter 模块,避免误导真实实现入口。
同步更新模块说明,聚焦实际的 FUSE 实现位置。
### 测试与回归保障
新增/更新了 Redis 相关回归测试,覆盖以下关键场景: