docs(rm-forbid): correct help text to match device/inode-level protec… - #158
Open
yuKing123-king wants to merge 1 commit into
Open
yuKing123-king wants to merge 1 commit into
yuKing123-king wants to merge 1 commit into
Conversation
…tion Signed-off-by: Wang Yu <wangyu6@uniontech.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rm-forbid的帮助文本是从"查询文件占用"类工具复制来的,与工具实际功能严重不符,按文档操作必然踩坑:标题错误:
To query who are occupying the specified file.—— 工具根本不查询谁占用文件,而是阻止删除被进程打开的文件(BPF LSM 在path_unlink/path_rmdir返回-EBUSY)。-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 也删不掉。