Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib/vfscore: Reorder locks in *at syscalls
*at syscalls are implemented in Unikraft in two stages: (1) build the full target path relative to the supplied dirfd, and (2) delegate to the regular syscall. Previously these syscalls held the lock on the dirfd vnode throughout steps (1) and (2); however, the sub-syscalls often need to acquire the same lock (along with perhaps others), causing double-lock asserts to trigger. This commit changes this logic to only hold the vnode lock during step (1) and release it immediately before (2). While this relaxes the previous atomicity guarantees somewhat, holding the vnode lock on dirfd only prevented concurrent changes to first-generation descendents, and unorthogonal and arguably unexpected behavior. The useful purpose of holding the dirfd lock is to ensure we build a full path that was (at one point in time) valid, with the sub-syscalls implementing their own atomicity guarantees as per usual. 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: #951
- Loading branch information