-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 double-lock bug in symlink #952
Conversation
This change adds a variant of namei_last_nofollow that can be called with the lock on ddp->d_vnode held, as well as factoring out common code between the two function variants. Signed-off-by: Andrei Tatar <andrei@unikraft.io>
This change fixes an issue where the lock of the destination parent directory was being taken more than once in the symlink syscall by using the locked variant of namei_last_nofollow. Signed-off-by: Andrei Tatar <andrei@unikraft.io>
❗ Checkpatch failed Beep boop! I ran Unikraft's
Truncated logs starting from first error 193d645:
View complete logs | Learn more about Unikraft's coding style and contribution guidelines. |
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.
Thanks @andreittr, this works as expected. Looks good too.
Reviewed-by: Maria Sfiraiala maria.sfiraiala@gmail.com
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.
Approved-by: Razvan Deaconescu razvand@unikraft.io
This change fixes an issue where the lock of the destination parent directory was being taken more than once in the symlink syscall by using the locked variant of namei_last_nofollow. Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #952
Description of changes
This change fixes an issue where the lock of the destination parent directory was being taken more than once in the symlink syscall by using a locked variant of namei_last_nofollow, which this PR also adds. In implementing the locked version of the latter function there's also some factoring out of common code.
Prerequisite checklist
checkpatch.uk
on your commit series before opening this PR;checkpatch.uk
complains, but I've purposely kept the style consistent within the file.Base target
Additional configuration
Test by issuing a symlink syscall; staging fails with a lock assert, fixed code behaves as expected.