-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
修复了ramfs中move_to的bug #673
修复了ramfs中move_to的bug #673
Conversation
感谢您的pull request,欢迎加入!🎉 DragonOS社区很兴奋地期待审核您的更改,您将在接下来的两周内收到 @fslongjin (or someone else) 的回复。💬😊 Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
提交代码之前要使用 |
@dragonosbot author |
kernel/src/filesystem/ramfs/mod.rs
Outdated
|
||
//修改其对父节点的引用 | ||
let mut old_inode = old_inode.0.lock(); | ||
let target = target.0.lock(); |
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.
不用对target加锁的,毕竟你在上面已经获取到了Arc
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.
要把target从&Arc转换为Weak并赋值给old_inode.parent,好像就只能上锁后去调用self_ref(还是我太菜了)
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.
只要Arc::downgrade就行。可以问问gpt
* 完善ramfs move_to * update
在kernel init时进行了测试,发现了move_to并未修改parent变量,本次pr修复了这个bug(已测试)