summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/kernel/syscalls.c1
-rw-r--r--src/kernel/vfs/request.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index 31bd0de..b424bf1 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -206,6 +206,7 @@ int _syscall_fs_wait(char __user *buf, int max_len, struct fs_wait_response __us
if (!backend) return -1;
process_transition(process_current, PS_WAITS4REQUEST);
+ assert(!backend->handler); // TODO allow multiple processes to wait on the same backend
backend->handler = process_current;
/* checking the validity of those pointers here would make
* vfs_request_accept simpler. TODO? */
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: