Skip to content
Snippets Groups Projects
Commit b5f1377f authored by Marek Vavruša's avatar Marek Vavruša
Browse files

journal: check minimum fsize limit and log error

parent 6c63a1de
No related branches found
No related tags found
No related merge requests found
......@@ -276,6 +276,13 @@ static int journal_open_file(journal_t *j)
goto open_file_error;
}
/* Check minimum fsize limit. */
size_t fslimit_min = jnode_base_pos(j->max_nodes) + 1024; /* At least 1K block */
if (j->fslimit < fslimit_min) {
log_error("journal '%s', filesize limit smaller than '%zu'", j->path, fslimit_min);
goto open_file_error;
}
/* Allocate nodes. */
const size_t node_len = sizeof(journal_node_t);
j->nodes = malloc(j->max_nodes * node_len);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment