Skip to content
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

lib/vfscore: Fix error return on symlink syscall #851

Closed

Conversation

StefanJum
Copy link
Member

The sys_symlink() function returns ENOENT if the lookup failed, instead of the actual error code lookup() exited with. This may not always be right, since lookup() can return other error codes (for example ELOOP).

Fix that by not setting the error code and just jump to the end of the function.

Note that for symlinks to work properly, @andraprs's PR #830 is also needed.

GitHub-Closes: #849

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.pl on your commit series before opening this PR;
  • Updated relevant documentation.

Base target

  • Architecture(s): x86_64
  • Platform(s): kvm

The `sys_symlink()` function returns `ENOENT` if the lookup failed,
instead of the actual error code `lookup()` exited with.
This may not always be right, since `lookup()` can return other error
codes (for example `ELOOP`).

Fix that by not setting the error code and just jump to the end of the
function.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
GitHub-Closes: unikraft#849
@StefanJum StefanJum requested a review from a team as a code owner April 20, 2023 10:42
@unikraft-bot
Copy link
Member

Checkpatch passed

Beep boop! I ran Unikraft's checkpatch.pl support script on your pull request and it all looks good!

SHA commit checkpatch
c44c183 lib/vfscore: Fix error return on symlink syscall

@razvand razvand requested review from andraprs and rares-miculescu and removed request for a team April 20, 2023 14:11
@razvand razvand added plat/kvm Unikraft for KVM lib/vfscore VFS Core Interface lang/c Issues or PRs to do with C/C++ arch/x86_64 labels Apr 20, 2023
Copy link
Contributor

@andraprs andraprs left a comment

Choose a reason for hiding this comment

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

Reviewed-by: Andra Paraschiv andra@unikraft.io

Thank you for the fix. :)

Copy link
Member

@marcrittinghaus marcrittinghaus left a comment

Choose a reason for hiding this comment

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

Thanks! 😃

Approved-by: Marc Rittinghaus marc.rittinghaus@unikraft.io

@razvand razvand added this to the v0.13.0 (Atlas) milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch/x86_64 lang/c Issues or PRs to do with C/C++ lib/vfscore VFS Core Interface plat/kvm Unikraft for KVM
Projects
Status: Done!
Development

Successfully merging this pull request may close these issues.

lib/vfscore: ERRNO gets wrongly set
5 participants