gracefully handle full /tmp file system
If /tmp happens to be full, fio gives you a very unhelpful error:
# ./fio rand-write-256k-q256.job
Bus error
Use posix_fallocate() to gracefully handle this condition.
Signed-off-by: Greg Edwards <greg.edwards@hp.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
diff --git a/mutex.c b/mutex.c
index abe073f..88044f3 100644
--- a/mutex.c
+++ b/mutex.c
@@ -33,6 +33,14 @@
return NULL;
}
+#ifdef FIO_HAVE_FALLOCATE
+ ret = posix_fallocate(fd, 0, sizeof(struct fio_mutex));
+ if (ret > 0) {
+ fprintf(stderr, "posix_fallocate mutex failed: %s\n", strerror(ret));
+ goto err;
+ }
+#endif
+
if (ftruncate(fd, sizeof(struct fio_mutex)) < 0) {
perror("ftruncate mutex");
goto err;