Skip to content

Conversation

@xboHodx
Copy link
Contributor

@xboHodx xboHodx commented Jan 8, 2026

  • chmod_test 的 ChmodTest.FchmodatNotDir
  • open_test 的 OpenTest.OpenNoFollowSymlink
  • 修复sysinfo_test并把sysinfo系统调用移到新的文件sys_sysinfo.rs中
  • mkdir_test 的 MkdirTest.FailsOnDirWithoutWritePerms
  • 修改gvisor测试的white_list和block_list

@github-actions github-actions bot added Bug fix A bug is fixed in this pull request test Unitest/User space test labels Jan 8, 2026
@fslongjin
Copy link
Member

bugbot run

@xboHodx xboHodx changed the title fix(vfs): 添加路径为空和符号链接处理的错误检查 [TBD] fix(vfs): 添加路径为空和符号链接处理的错误检查 Jan 8, 2026
@github-actions github-actions bot added the ambiguous The title of PR/issue doesn't match the format label Jan 8, 2026
@xboHodx xboHodx changed the title [TBD] fix(vfs): 添加路径为空和符号链接处理的错误检查 [TBD] fix(syscall): 修复一些系统调用 Jan 8, 2026
@fslongjin
Copy link
Member

@codex review

Copy link

@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: 3284ad11b4

ℹ️ 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".

@xboHodx
Copy link
Contributor Author

xboHodx commented Jan 10, 2026

bugbot run

@cursor
Copy link

cursor bot commented Jan 10, 2026

Skipping Bugbot: Unable to authenticate your request. Please make sure Bugbot is properly installed and configured for this repository.

@xboHodx xboHodx changed the title [TBD] fix(syscall): 修复一些系统调用 fix(syscall): 修复一些系统调用 Jan 10, 2026
@github-actions github-actions bot removed the ambiguous The title of PR/issue doesn't match the format label Jan 10, 2026
@fslongjin
Copy link
Member

@codex review

Copy link

@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: 52d659b36a

ℹ️ 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".

@xboHodx xboHodx changed the title fix(syscall): 修复一些系统调用 [TBD] fix(syscall): 修复一些系统调用 Jan 11, 2026
@github-actions github-actions bot added the ambiguous The title of PR/issue doesn't match the format label Jan 11, 2026
@xboHodx xboHodx changed the title [TBD] fix(syscall): 修复一些系统调用 fix(syscall): 修复一些系统调用 Jan 11, 2026
@github-actions github-actions bot removed the ambiguous The title of PR/issue doesn't match the format label Jan 11, 2026
Comment on lines 17 to 32
#[derive(Debug, Default, Copy, Clone)]
#[repr(C)]
pub struct SysInfo {
uptime: u64,
loads: [u64; 3],
totalram: u64,
freeram: u64,
sharedram: u64,
bufferram: u64,
totalswap: u64,
freeswap: u64,
procs: u16,
pad: u16,
totalhigh: u64,
freehigh: u64,
mem_unit: u32,
Copy link
Member

Choose a reason for hiding this comment

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

这个是给用户态的结构体,如果外面用不到,就不用pub。 并且要以PosixSysInfo这样命名,以便跟内核其他系统调用的命名规则一致。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

可是sysinfo不是posix标准的系统调用呀

Copy link
Member

Choose a reason for hiding this comment

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

可是sysinfo不是posix标准的系统调用呀

这里的Posix的意思指的是对齐Linux的面向用户态的结构体。避免内核态把他混淆使用。

sysinfo.freehigh = 0;
sysinfo.mem_unit = 1;

writer.copy_one_to_user(&sysinfo, 0)?;
Copy link
Member

Choose a reason for hiding this comment

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

要使用基于异常表保护的版本

Copy link
Contributor

Choose a reason for hiding this comment

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

UserBuffer 中有基于异常表保护拷贝实现的 write_one<T>() ,可以考虑使用这个。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image 好多用这个的

Copy link
Contributor

@mistcoversmyeyes mistcoversmyeyes Jan 12, 2026

Choose a reason for hiding this comment

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

@xboHodx xboHodx requested a review from fslongjin January 12, 2026 13:16
Copy link
Member

Choose a reason for hiding this comment

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

这样设置不对8。 墙上时间的更新我理解应该是update_walltime 的职责? 在update_walltime以外的地方,直接去改xtime的值我觉得应该是不合理的。因为时间子系统有自己的一套机制去更新这个。

我理解你这里的需求是计算系统自启动以来的时间?那直接Instant::now不就好了。在LATE的时间点,时间子系统都已经工作了。

Comment on lines 17 to 32
#[derive(Debug, Default, Copy, Clone)]
#[repr(C)]
pub struct SysInfo {
uptime: u64,
loads: [u64; 3],
totalram: u64,
freeram: u64,
sharedram: u64,
bufferram: u64,
totalswap: u64,
freeswap: u64,
procs: u16,
pad: u16,
totalhigh: u64,
freehigh: u64,
mem_unit: u32,
Copy link
Member

Choose a reason for hiding this comment

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

可是sysinfo不是posix标准的系统调用呀

这里的Posix的意思指的是对齐Linux的面向用户态的结构体。避免内核态把他混淆使用。

Comment on lines 782 to 785
/// 获取当前 PID namespace 中的进程数量
pub fn ns_process_count() -> usize {
Self::current_pcb().active_pid_ns().pid_allocated()
}
Copy link
Member

Choose a reason for hiding this comment

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

这个函数就那个地方用到,我理解直接ProcessManager::current_pidns().pid_allocated()这样比较好。应当在pidns那边impl一个current_pidns()而不是这里这个ns_process_count()

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

Labels

Bug fix A bug is fixed in this pull request test Unitest/User space test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants