From 874d01dd473b64aae88fac219125fc337e06c1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20W=C3=BCnsche?= Date: Tue, 10 Oct 2023 16:36:23 +0200 Subject: [PATCH] fio: check for proper maximum file size --- fio-haura/src/fio-engine-haura.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fio-haura/src/fio-engine-haura.c b/fio-haura/src/fio-engine-haura.c index 5aa16a6e..99914b7e 100644 --- a/fio-haura/src/fio-engine-haura.c +++ b/fio-haura/src/fio-engine-haura.c @@ -304,10 +304,8 @@ static int fio_haura_setup(struct thread_data *td) { /* Haura needs some additional space to provide extra data like object * pointers and metadata. This is more of a hack, but nonetheless. */ creat(td->files[idx]->file_name, 0644); - if (truncate(td->files[idx]->file_name, td->o.size + (50 * 1024 * 1024))) { - fprintf( - stderr, - "Could not retruncate file to provide enough storage for Haura.\n"); + if (truncate(td->files[idx]->file_name, max(td->o.file_size_high, td->o.size) + (50 * 1024 * 1024))) { + fprintf(stderr,"Could not retruncate file to provide enough storage for Haura.\n"); } }