Skip to content

Commit

Permalink
Tune unmount_all() function
Browse files Browse the repository at this point in the history
  • Loading branch information
atrosinenko committed Sep 24, 2023
1 parent 2fa8395 commit d305082
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runtime/common/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,16 @@ 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...",
part, partition->fstype, lkl_strerror(ret));
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)
Expand Down

0 comments on commit d305082

Please sign in to comment.