Document that segment_above must be below 5Gb.

And add corresponding test. Also enfore a segment_size below
segment_above.
This commit is contained in:
Pascal Obry
2016-02-02 10:57:25 +01:00
parent 5d7d643ffa
commit 7de70ff9d4
2 changed files with 17 additions and 0 deletions
+2
View File
@@ -81,6 +81,8 @@ USE AS NON-ROOT:
BUGS/SHORTCOMINGS:
* A segment size is limited to 5Gb (this is not hubicfuse limit, but HubiC implementation).
So segment_above should never exceed 5Gb.
* rename() doesn't work on directories (and probably never will).
* When reading and writing files, it buffers them in a local temp file.
* It keeps an in-memory cache of the directory structure, so it may not be
+15
View File
@@ -872,6 +872,21 @@ int main(int argc, char** argv)
cache_timeout = atoi(options.cache_timeout);
segment_size = atoll(options.segment_size);
segment_above = atoll(options.segment_above);
// check consistency
const unsigned long FiveGb = (unsigned long)5 * (unsigned long)(1 << 30);
if (segment_above > FiveGb)
{
printf ("A segment cannot be larger than 5Gb\n");
return 1;
}
if (segment_size > segment_above)
{
printf ("segment_size must be smaller than segment_above\n");
return 1;
}
// this is ok since main is on the stack during the entire execution
override_storage_url = options.storage_url;
public_container = options.container;