---
 bin/varnishd/mgt/mgt_shmem.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bin/varnishd/mgt/mgt_shmem.c b/bin/varnishd/mgt/mgt_shmem.c
index dc1fa5c..5db385a 100644
--- a/bin/varnishd/mgt/mgt_shmem.c
+++ b/bin/varnishd/mgt/mgt_shmem.c
@@ -47,6 +47,7 @@
 #include "flopen.h"
 #include "vapi/vsm_int.h"
 #include "vmb.h"
+#include "vfil.h"
 
 #ifndef MAP_HASSEMAPHORE
 #define MAP_HASSEMAPHORE 0 /* XXX Linux */
@@ -173,6 +174,11 @@ vsm_zerofile(const char *fn, ssize_t size)
                u += i;
        }
        AZ(ftruncate(fd, (off_t)size));
+       if (VFIL_fallocate(fd, (off_t)size)) {
+               fprintf(stderr, "Could not preallocate %s: %s\n",
+                   fn, strerror(errno));
+               return (-1);
+       }
        return (fd);
 }
 
-- 
2.1.1


_______________________________________________
varnish-dev mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Reply via email to