[PATCH 1/8] Remove the 80% file system free space check

Martin Blix Grydeland martin at varnish-software.com
Mon Oct 6 17:50:04 CEST 2014


This check never worked as intended for several reasons:

- Didn't take the existing file size into account, causing it to
  succeed on first startup but fail on next

- Sparse files were not handled, and can't be handled as we don't know
  where in the file a hole could be and whether truncation actually
  would change the number of blocks used at all

Fixes: #1343
---
 bin/varnishd/storage/stevedore_utils.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/bin/varnishd/storage/stevedore_utils.c b/bin/varnishd/storage/stevedore_utils.c
index a86d57e..e30cbcc 100644
--- a/bin/varnishd/storage/stevedore_utils.c
+++ b/bin/varnishd/storage/stevedore_utils.c
@@ -223,11 +223,6 @@ STV_FileSize(int fd, const char *size, unsigned *granularity, const char *ctx)
 	if (i)
 		fprintf(stderr, "WARNING: (%s) file size reduced"
 		    " to %ju due to system \"off_t\" limitations\n", ctx, l);
-	else if (l - st.st_size > fssize) {
-		l = fssize * 80 / 100;
-		fprintf(stderr, "WARNING: (%s) file size reduced"
-		    " to %ju (80%% of available disk space)\n", ctx, l);
-	}
 
 	if (sizeof(void *) == 4 && l > INT32_MAX) { /*lint !e506 !e774 !e845 */
 		fprintf(stderr,
-- 
2.1.1




More information about the varnish-dev mailing list