vmmcache: redo how vnode locking is expected

This commit is contained in:
Matheus
2024-09-18 18:03:07 -03:00
parent 216a2e8d01
commit d5a4f2a4ad
6 changed files with 44 additions and 25 deletions
+4
View File
@@ -17,9 +17,13 @@ syscallret_t syscall_ftruncate(int fd, size_t size) {
goto cleanup;
}
MUTEX_ACQUIRE(&file->vnode->size_lock, false);
VOP_LOCK(file->vnode);
ret.errno = VOP_RESIZE(file->vnode, size, &current_thread()->proc->cred);
VOP_UNLOCK(file->vnode);
MUTEX_RELEASE(&file->vnode->size_lock);
ret.ret = ret.errno ? -1 : 0;