Permalink
Browse files

Bail out with arg error if specifying a size larger than the file

system size

This is to spot obvious typos
  • Loading branch information...
1 parent f7b3ef7 commit 551e0de9e89a83b6b465fc8800dfc9b47217a9dc @mbgrydeland mbgrydeland committed with Lasse Karstensen Oct 6, 2014
Showing with 4 additions and 0 deletions.
  1. +4 −0 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);
}
/*

0 comments on commit 551e0de

Please sign in to comment.