main: ensure inital presence of actual dir

This commit is contained in:
Thomas Schoebel-Theuer 2022-07-03 11:08:49 +02:00 committed by Thomas Schoebel-Theuer
parent de25b2e1ba
commit 90a6c6e0c0
1 changed files with 14 additions and 0 deletions

View File

@ -8141,6 +8141,15 @@ static void exit_main(void)
brick_msleep(1000);
}
static noinline
void ensure_actual(char *peer)
{
char *actual_dir = path_make("/mars/actual-%s", peer);
(void)mars_mkdir(actual_dir);
brick_string_free(actual_dir);
}
static int __init init_main(void)
{
#if defined(MARS_HAS_PREPATCH) || \
@ -8237,6 +8246,11 @@ static int __init init_main(void)
brick_mem_reserve();
#endif
/* Ensure that the bare minimum is present, even when
* userspace support is missing.
*/
ensure_actual(my_id());
status = compute_emergency_mode();
if (unlikely(status < 0)) {
MARS_ERR("Sorry, your /mars/ filesystem is too small!\n");