[master] f769dd1 Bail out with arg error if specifying a size larger than the file system size

Martin Blix Grydeland martin at varnish-software.com
Tue Oct 21 12:25:42 CEST 2014


commit f769dd1cb8bfb0666784aa4af2a35011a44f9662
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 60b640b..32a447f 100644
--- a/bin/varnishd/storage/stevedore_utils.c
+++ b/bin/varnishd/storage/stevedore_utils.c
@@ -182,6 +182,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