Skip to content

feat(mountstats): 新增proc挂载导出接口实现#1832

Open
xboHodx wants to merge 8 commits into
DragonOS-Community:masterfrom
xboHodx:feat/mountstats
Open

feat(mountstats): 新增proc挂载导出接口实现#1832
xboHodx wants to merge 8 commits into
DragonOS-Community:masterfrom
xboHodx:feat/mountstats

Conversation

@xboHodx
Copy link
Copy Markdown
Contributor

@xboHodx xboHodx commented Apr 3, 2026

  • 实现/proc/[pid]/mounts、/proc/[pid]/mountinfo、/proc/[pid]/mountstats接口
  • 新增mount_view模块统一处理挂载视图渲染逻辑
  • 支持按目标进程视角导出挂载信息
  • 文档添加procfs相关章节

xboHodx added 3 commits March 20, 2026 16:10
…ng and validation

- Deleted init_skill.py as it was redundant.
- Updated package_skill.py to exclude unnecessary files and directories during packaging.
- Enhanced quick_validate.py to include compatibility field validation and improved error messages.
- Added run_eval.py to evaluate skill descriptions against queries and output results in JSON format.
- Introduced run_loop.py to facilitate an iterative evaluation and improvement process for skill descriptions.
- Created utils.py for shared utility functions, including SKILL.md parsing.

Signed-off-by: xboHodx <xbohodx2024@gmail.com>
- 实现/proc/[pid]/mounts、/proc/[pid]/mountinfo、/proc/[pid]/mountstats接口
- 新增mount_view模块统一处理挂载视图渲染逻辑
- 支持按目标进程视角导出挂载信息
- 文档添加procfs相关章节

Signed-off-by: xboHodx <xbohodx2024@gmail.com>
@github-actions github-actions Bot added the ambiguous The title of PR/issue doesn't match the format label Apr 3, 2026
@xboHodx xboHodx changed the title Feat/mountstats 新增proc挂载导出接口实现 feat(mountstats): 新增proc挂载导出接口实现 Apr 3, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed ambiguous The title of PR/issue doesn't match the format labels Apr 3, 2026
Signed-off-by: xboHodx <xbohodx2024@gmail.com>
@fslongjin
Copy link
Copy Markdown
Member

skill creator应该不要提交到dragonos吧?
然后就是为什么这个diff这么大

… packaging and validation"

This reverts commit 250dc9b.
@xboHodx
Copy link
Copy Markdown
Contributor Author

xboHodx commented Apr 4, 2026

skill creator应该不要提交到dragonos吧? 然后就是为什么这个diff这么大

这是 #1823 的skill,不小心交上去了。现在撤下来应该没问题了。

…tats

Signed-off-by: xboHodx <xbohodx2024@gmail.com>
@fslongjin
Copy link
Copy Markdown
Member

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a6e4c94bb

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

fn render_mount_file(pid: RawPid, kind: ProcMountRenderKind) -> Result<Vec<u8>, SystemError> {
let target = ProcessManager::find(pid).ok_or(SystemError::ESRCH)?;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resolve proc PID with namespace-aware lookup

render_mount_file() looks up the target task with ProcessManager::find(pid), which uses the global/raw PID table, but /proc/[pid] entries are created from virtual PIDs (find_task_by_vpid in procfs/pid/mod.rs). In a non-initial PID namespace, opening /proc/<vpid>/mounts|mountinfo|mountstats can therefore resolve the wrong process (or ESRCH), producing incorrect mount data and potentially exposing another task’s mount view. Use a namespace-aware PID lookup for the proc PID here.

Useful? React with 👍 / 👎.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants