diff options
author | dzwdz | 2022-04-15 23:42:43 +0200 |
---|---|---|
committer | dzwdz | 2022-04-15 23:42:43 +0200 |
commit | 42e4b941b70499f5cf10f41126af1634821d72d5 (patch) | |
tree | 6b56775263837b7883b7a05a7603bc59274ce05d /src/init/tests/main.c | |
parent | 26849aa2b3f49cbad8be4688800667e2d89aa5db (diff) |
kernel/vfs: don't hang on orphaned vfs calls
Diffstat (limited to 'src/init/tests/main.c')
-rw-r--r-- | src/init/tests/main.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/init/tests/main.c b/src/init/tests/main.c index 34187fc..1c1e817 100644 --- a/src/init/tests/main.c +++ b/src/init/tests/main.c @@ -79,6 +79,18 @@ static void test_interrupted_fs(void) { } } +static void test_orphaned_fs(void) { + handle_t h = _syscall_fs_fork2(); + if (h) { + _syscall_mount(h, "/", 1); + int ret = _syscall_open("/", 1); + // no handler will ever be available to handle this call - the syscall should instantly return + _syscall_exit(ret < 0 ? 0 : -1); + } else { + _syscall_exit(0); + } +} + static void stress_fork(void) { /* run a lot of processes */ for (size_t i = 0; i < 2048; i++) { @@ -92,5 +104,6 @@ void test_all(void) { run_forked(test_await); run_forked(test_faults); run_forked(test_interrupted_fs); + run_forked(test_orphaned_fs); // run_forked(stress_fork); } |