Skip to content

docs(rm-forbid): correct help text to match device/inode-level protec… - #158

Open
yuKing123-king wants to merge 1 commit into
DKapture:mainfrom
yuKing123-king:docs/rm-forbid-help-accuracy
Open

yuKing123-king wants to merge 1 commit into
DKapture:mainfrom
yuKing123-king:docs/rm-forbid-help-accuracy

Conversation

@yuKing123-king

Copy link
Copy Markdown
Contributor

rm-forbid 的帮助文本是从"查询文件占用"类工具复制来的,与工具实际功能严重不符,按文档操作必然踩坑:

  1. 标题错误:To query who are occupying the specified file. —— 工具根本不查询谁占用文件,而是阻止删除被进程打开的文件(BPF LSM 在 path_unlink/path_rmdir 返回 -EBUSY)。

  2. -p 的描述误导:path of the file to watch on 暗示保护范围是"这个路径",实际 -p 只是对路径 stat() 一下取 st_dev(rm-forbid.cpp:172-178),路径字符串随即丢弃,BPF 侧根本收不到路径。真实保护范围是"该设备上所有 d_lockref.count > 1 的文件"(rm-forbid.bpf.c:79-89)。同一挂载点下 dir1 和 dir2 设备号相同,都会被保护——用户以为只保护 dir1,结果 dir2 也删不掉。

…tion

Signed-off-by: Wang Yu <wangyu6@uniontech.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant