From: teor Date: Sun, 28 May 2017 12:16:00 +0000 (+1000) Subject: Don't underflow usage when it is unknown and a file is removed X-Git-Tag: tor-0.3.1.3-alpha~23^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=334fe6bb6b124c2f3eb1186610999446d57cde76;p=thirdparty%2Ftor.git Don't underflow usage when it is unknown and a file is removed Part of #22424. --- diff --git a/src/common/storagedir.c b/src/common/storagedir.c index 9140ed29bd..532fa2a2c8 100644 --- a/src/common/storagedir.c +++ b/src/common/storagedir.c @@ -425,7 +425,7 @@ storage_dir_remove_file(storage_dir_t *d, } } if (unlink(ipath) == 0) { - if (! BUG(d->usage < size)) { + if (d->usage_known && ! BUG(d->usage < size)) { d->usage -= size; } } else {