From d30508258b5b787acda9860a174dd0c45e5f67b3 Mon Sep 17 00:00:00 2001 From: Anatoly Trosinenko Date: Sun, 24 Sep 2023 15:21:42 +0300 Subject: [PATCH] Tune unmount_all() function --- runtime/common/kernel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/common/kernel.c b/runtime/common/kernel.c index 8ab296f..76f58f9 100644 --- a/runtime/common/kernel.c +++ b/runtime/common/kernel.c @@ -124,7 +124,7 @@ static void unmount_all(struct fuzzer_state *state) { if (strncmp(partition->fstype, FSTYPE_RAW, strlen(FSTYPE_RAW)) == 0) { continue; } - int ret = lkl_umount_dev(partition->blockdev.lkl_disk_id, 0, 0, 1); + int ret = lkl_umount_dev(partition->blockdev.lkl_disk_id, 0, 0, 10 * 1000 /* prevent unstable results if too small timeout */); if (ret) { // TODO WARN(state, "Cannot unmount #%d, type = %s (%s), just exiting...", @@ -132,6 +132,8 @@ static void unmount_all(struct fuzzer_state *state) { stop_processing(state); } } + INVOKE_SYSCALL_0(state, sync); + kernel_write_string_to_file(state, "/proc/sys/vm/drop_caches", "3", false); } static void mount_all(struct fuzzer_state *state)