[4.0] 551e0de Bail out with arg error if specifying a size larger than the file system size

Lasse Karstensen lkarsten at varnish-software.com
Thu Jan 15 16:35:40 CET 2015


commit 551e0de9e89a83b6b465fc8800dfc9b47217a9dc
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Mon Oct 6 15:33:34 2014 +0200

    Bail out with arg error if specifying a size larger than the file
    system size
    
    This is to spot obvious typos

diff --git a/bin/varnishd/storage/stevedore_utils.c b/bin/varnishd/storage/stevedore_utils.c
index fe3514b..ace90af 100644
--- a/bin/varnishd/storage/stevedore_utils.c
+++ b/bin/varnishd/storage/stevedore_utils.c
@@ -209,6 +209,10 @@ STV_FileSize(int fd, const char *size, unsigned *granularity, const char *ctx)
 		if (l < 1024*1024)
 			ARGV_ERR("(%s) size \"%s\": too small, "
 			    "did you forget to specify M or G?\n", ctx, size);
+
+		if (l > fssize)
+			ARGV_ERR("(%s) size \"%s\": larger than file system\n",
+			    ctx, size);
 	}
 
 	/*



More information about the varnish-commit mailing list