-
Notifications
You must be signed in to change notification settings - Fork 261
[LibOS] Rewrite rename* syscalls #943
[LibOS] Rewrite rename* syscalls #943
Conversation
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.
The logic seems racy. But other fs related codes (open, unlink, rmdir, mkdir) seem racy.
So I don't block this due to it.
Reviewable status: 0 of 9 files reviewed, all discussions resolved, not enough approvals from maintainers (3 more required), not enough approvals from different teams (2 more required, approved so far: )
LibOS/shim/src/fs/shim_namei.c, line 834 at r1 (raw file):
} int get_dirfd_dentry(int dirfd, struct shim_dentry** dir) {
Except the last put_handle(), Is this just code cleanup?
LibOS/shim/src/fs/shim_namei.c, line 858 at r1 (raw file):
get_dentry(hdl->dentry); *dir = hdl->dentry; put_handle(hdl);
good catch.
LibOS/shim/src/sys/shim_fs.c, line 605 at r1 (raw file):
} if ((ret = new_dent->fs->d_ops->unlink(new_dent->parent,
+1 to drop unlink logic. It should be up to fs.
LibOS/shim/src/sys/shim_fs.c, line 622 at r1 (raw file):
new_dent->state &= ~DENTRY_NEGATIVE; if (old_dent->state & DENTRY_ISDIRECTORY) { new_dent->state |= DENTRY_ISDIRECTORY;
Is there any reason why this isn't updated before rename method?
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.
Reviewed 9 of 9 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: Intel) (waiting on @boryspoplawski)
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.
I agree, but there are many more issues with current fs implementation and I don't think all of them can be fixed without major changes/reworks.
Reviewable status: all files reviewed, 1 unresolved discussion, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: Intel) (waiting on @yamahata)
LibOS/shim/src/fs/shim_namei.c, line 834 at r1 (raw file):
Previously, yamahata wrote…
Except the last put_handle(), Is this just code cleanup?
Yes, just wanted to change this function name, as previous was a bit missleading
LibOS/shim/src/sys/shim_fs.c, line 605 at r1 (raw file):
Previously, yamahata wrote…
+1 to drop unlink logic. It should be up to fs.
Exactly
LibOS/shim/src/sys/shim_fs.c, line 622 at r1 (raw file):
Previously, yamahata wrote…
Is there any reason why this isn't updated before rename method?
If rename fails, old_dent should stay in the same state as it was before.
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.
Reviewable status: 8 of 9 files reviewed, 1 unresolved discussion, not enough approvals from maintainers (3 more required), not enough approvals from different teams (2 more required, approved so far: ) (waiting on @yamahata)
LibOS/shim/src/sys/shim_fs.c, line 622 at r1 (raw file):
Previously, boryspoplawski (Borys Popławski) wrote…
If rename fails, old_dent should stay in the same state as it was before.
Actually you are right. It was even updated above - so removed unneeded update here.
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.
implementation and I don't think all of them can be fixed without major changes/reworks.
fully agreed.
Reviewable status: 8 of 9 files reviewed, all discussions resolved, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: Intel) (waiting on @yamahata)
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.
Reviewed 8 of 9 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed, all discussions resolved, not enough approvals from maintainers (1 more required)
Present implementation is utterly broken, does not work even in simplest cases.
If `get_new_dentry` returns successfully, it increases returned dentry's reference counter by one, which matches other similar functions' behavior.
0c3a5a9
to
289ac3a
Compare
Jenkins, test this please |
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.
Reviewable status: all files reviewed, all discussions resolved, not enough approvals from maintainers (1 more required), not enough approvals from different teams (1 more required, approved so far: ITL)
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.
Reviewed 1 of 1 files at r2.
Reviewable status:complete! all files reviewed, all discussions resolved
Affected components
Description of the changes
Unfortunately current implementation of fs does not allow for renaming anything but regular files.
Fixes some issues from #903 constrained by above statement.
How to test this PR?
This change is