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
vn_lock(newdirdp->d_vnode);
/* newpath should not already exist */
- if (unlikely(namei_last_nofollow(np, newdirdp, &newdp) == 0)) {
+ if (unlikely(namei_last_nofollow_locked(np, newdirdp, &newdp) == 0)) {
drele(newdp);
error = EEXIST;
goto out_unlock;