From e55ace0f517ede6f3635341c8adadc7b90aa75c5 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 16 Apr 2022 18:31:21 +0200 Subject: kernel/vfs: be more strict about the state of `vfs_backend.handler` --- src/kernel/vfs/request.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/kernel/vfs') diff --git a/src/kernel/vfs/request.c b/src/kernel/vfs/request.c index 277c353..ad72264 100644 --- a/src/kernel/vfs/request.c +++ b/src/kernel/vfs/request.c @@ -21,9 +21,8 @@ int vfs_request_create(struct vfs_request req_) { case VFS_BACK_ROOT: return vfs_root_handler(req); case VFS_BACK_USER: - if (req->backend->handler - && req->backend->handler->state == PS_WAITS4REQUEST) - { + if (req->backend->handler) { + assert(req->backend->handler->state == PS_WAITS4REQUEST); vfs_request_accept(req); } else { // backend isn't ready yet, join the queue @@ -65,6 +64,7 @@ int vfs_request_accept(struct vfs_request *req) { process_transition(handler, PS_RUNNING); handler->handled_req = req; + req->backend->handler = NULL; regs_savereturn(&handler->regs, 0); return 0; fail: -- cgit v1.2.3