This check never worked as intended for several reasons:

- Didn't take the existing file size into account, causing it to
  succeed on first startup but fail on next

- Sparse files were not handled, and can't be handled as we don't know
  where in the file a hole could be and whether truncation actually
  would change the number of blocks used at all

Fixes: #1343
---
 bin/varnishd/storage/stevedore_utils.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/bin/varnishd/storage/stevedore_utils.c 
b/bin/varnishd/storage/stevedore_utils.c
index a86d57e..e30cbcc 100644
--- a/bin/varnishd/storage/stevedore_utils.c
+++ b/bin/varnishd/storage/stevedore_utils.c
@@ -223,11 +223,6 @@ STV_FileSize(int fd, const char *size, unsigned 
*granularity, const char *ctx)
        if (i)
                fprintf(stderr, "WARNING: (%s) file size reduced"
                    " to %ju due to system \"off_t\" limitations\n", ctx, l);
-       else if (l - st.st_size > fssize) {
-               l = fssize * 80 / 100;
-               fprintf(stderr, "WARNING: (%s) file size reduced"
-                   " to %ju (80%% of available disk space)\n", ctx, l);
-       }
 
        if (sizeof(void *) == 4 && l > INT32_MAX) { /*lint !e506 !e774 !e845 */
                fprintf(stderr,
-- 
2.1.1


_______________________________________________
varnish-dev mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Reply via email to