-
-
Notifications
You must be signed in to change notification settings - Fork 158
fix: mkdir输出错误信息; feat: 实现get_pathname #615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Description updated to latest commit (c031fdb) |
PR Analysis
PR Feedback💡 General suggestions: The implementation of get_pathname seems to be a good approach to standardize pathname handling. Ensure that the function is robust and can handle all edge cases, especially considering the potential for pathnames with special characters or very long lengths. Additionally, verify that the error messages for mkdir are now accurately reflecting the input errors. ✨ Usage guide:Overview:
With a configuration file, use the following template:
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Usage guide:Overview:
With a configuration file, use the following template:
See the improve usage page for a more comprehensive guide on using this tool. |
更新之后直接提交,然后push就行,不用重新开一个PR,如果重新开了PR的话,麻烦把之前那个PR的链接粘贴到这里来 |
@dragonosbot assign @GnoCiYeH |
之前那个pr我也是更新合并到fork出来的库,我怕又冲突了,我直接把那个pr关了 |
噢噢噢哈哈明白了
…---原始邮件---
发件人: ***@***.***>
发送时间: 2024年3月17日(周日) 凌晨0:15
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [DragonOS-Community/DragonOS] fix: mkdir输出错误信息; feat: 实现get_pathname (PR #615)
之前那个pr我也是更新合并到fork出来的库,我怕又冲突了,我直接把那个pr关了
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
kernel/src/syscall/mod.rs
Outdated
let path: &CStr = unsafe { CStr::from_ptr(args[1] as *const c_char) }; | ||
let pathname = args[1] as *const u8; | ||
let pathname = | ||
Self::get_pathname(pathname).map_err(|_| SystemError::EINVAL.into())?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些操作不应该在这里执行。应当写到vfs里面的函数内。因为这样会造成vfs和通用的syscall入口的耦合。
kernel/src/filesystem/vfs/syscall.rs
Outdated
@@ -1017,6 +985,21 @@ impl Syscall { | |||
kwarn!("fchmod not fully implemented"); | |||
return Ok(0); | |||
} | |||
|
|||
/// @brief 处理文件路径字符串,并将其从用户空间复制到内核空间 | |||
pub fn get_pathname(pathname: *const u8) -> Result<String, SystemError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数我觉得可以删掉,因为判断是否超过最大长度,check_and_clone_str已经做了。然后判断是否为空这个,不需要判断。因为lookup的时候本身就会去报出相应的错误。
@dragonosbot author |
@dragonosbot review |
User description
此拉取请求取消了mkdir时输入不正确的目录名输出错误信息,和实现了get_pathname,用来统一在用户态获取路径名时进行合法性判断并将其复制到内核空间
Type
Bug fix, Enhancement
Description
此拉取请求修复了mkdir时输入不正确的目录名输出错误信息的问题,并实现了get_pathname函数,用于在用户态获取路径名时进行合法性判断并将其复制到内核空间。此外,还更新了文件路径处理函数和系统调用处理函数,现在使用get_pathname函数来处理文件路径字符串,并将其从用户空间复制到内核空间。
Changes walkthrough
open.rs
修复mkdir错误输出和实现路径名获取功能
kernel/src/filesystem/vfs/open.rs
syscall.rs
更新文件路径处理函数
kernel/src/filesystem/vfs/syscall.rs
更新了文件路径处理函数,现在使用get_pathname函数来处理文件路径字符串,并将其从用户空间复制到内核空间。
mod.rs
更新系统调用路径处理函数
kernel/src/syscall/mod.rs
更新了系统调用处理函数,现在使用get_pathname函数来处理文件路径字符串,并将其从用户空间复制到内核空间。
✨ Usage guide:
Overview:
The
describe
tool scans the PR code changes, and generates a description for the PR - title, type, summary, walkthrough and labels. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.When commenting, to edit configurations related to the describe tool (
pr_description
section), use the following template:With a configuration file, use the following template:
Enabling\disabling automation
meaning the
describe
tool will run automatically on every PR, will keep the original title, and will add the original user description above the generated description.the tool will replace every marker of the form
pr_agent:marker_name
in the PR description with the relevant content, wheremarker_name
is one of the following:type
: the PR type.summary
: the PR summary.walkthrough
: the PR walkthrough.Note that when markers are enabled, if the original PR description does not contain any markers, the tool will not alter the description at all.
Custom labels
The default labels of the
describe
tool are quite generic: [Bug fix
,Tests
,Enhancement
,Documentation
,Other
].If you specify custom labels in the repo's labels page or via configuration file, you can get tailored labels for your use cases.
Examples for custom labels:
Main topic:performance
- pr_agent:The main topic of this PR is performanceNew endpoint
- pr_agent:A new endpoint was added in this PRSQL query
- pr_agent:A new SQL query was added in this PRDockerfile changes
- pr_agent:The PR contains changes in the DockerfileThe list above is eclectic, and aims to give an idea of different possibilities. Define custom labels that are relevant for your repo and use cases.
Note that Labels are not mutually exclusive, so you can add multiple label categories.
Make sure to provide proper title, and a detailed and well-phrased description for each label, so the tool will know when to suggest it.
Inline File Walkthrough 💎
For enhanced user experience, the
describe
tool can add file summaries directly to the "Files changed" tab in the PR page.This will enable you to quickly understand the changes in each file, while reviewing the code changes (diffs).
To enable inline file summary, set
pr_description.inline_file_summary
in the configuration file, possible values are:'table'
: File changes walkthrough table will be displayed on the top of the "Files changed" tab, in addition to the "Conversation" tab.true
: A collapsable file comment with changes title and a changes summary for each file in the PR.false
(default): File changes walkthrough will be added only to the "Conversation" tab.Utilizing extra instructions
The
describe
tool can be configured with extra instructions, to guide the model to a feedback tailored to the needs of your project.Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Notice that the general structure of the description is fixed, and cannot be changed. Extra instructions can change the content or style of each sub-section of the PR description.
Examples for extra instructions:
Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.
More PR-Agent commands
See the describe usage page for a comprehensive guide on using this tool.