diff options
author | dzwdz | 2022-04-15 23:04:58 +0200 |
---|---|---|
committer | dzwdz | 2022-04-15 23:04:58 +0200 |
commit | 26849aa2b3f49cbad8be4688800667e2d89aa5db (patch) | |
tree | 17bb2aab1d6ac714985b81c2d98fccf3ffa887fc /src/init | |
parent | 6613d7e5f3c2e704a6812b0fbcaf79ade8d19980 (diff) |
kernel/vfs: don't hang waiting for a vfs backend after it exit()s
Diffstat (limited to 'src/init')
-rw-r--r-- | src/init/tests/main.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/init/tests/main.c b/src/init/tests/main.c index 65c2370..34187fc 100644 --- a/src/init/tests/main.c +++ b/src/init/tests/main.c @@ -64,6 +64,21 @@ static void test_faults(void) { assert(await_cnt == 2); } +static void test_interrupted_fs(void) { + handle_t h = _syscall_fs_fork2(); + if (h) { + _syscall_mount(h, "/", 1); + int ret = _syscall_open("/", 1); + // the handler quits while handling that call - but this syscall should return anyways + _syscall_exit(ret < 0 ? 0 : -1); + } else { + // TODO make a similar test with all 0s passed to fs_wait + struct fs_wait_response res; + _syscall_fs_wait(NULL, 0, &res); + _syscall_exit(0); + } +} + static void stress_fork(void) { /* run a lot of processes */ for (size_t i = 0; i < 2048; i++) { @@ -76,5 +91,6 @@ static void stress_fork(void) { void test_all(void) { run_forked(test_await); run_forked(test_faults); - run_forked(stress_fork); + run_forked(test_interrupted_fs); +// run_forked(stress_fork); } |