[PATCH 3/8] Bail out with arg error if specifying a size larger than the file system size

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


This is to spot obvious typos
---
 bin/varnishd/storage/stevedore_utils.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bin/varnishd/storage/stevedore_utils.c b/bin/varnishd/storage/stevedore_utils.c
index ccb0614..d5ed033 100644
--- a/bin/varnishd/storage/stevedore_utils.c
+++ b/bin/varnishd/storage/stevedore_utils.c
@@ -206,6 +206,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);
 	}
 
 	/*
-- 
2.1.1




More information about the varnish-dev mailing list