[tor-commits] [tor/master] Don't underflow usage when it is unknown and a file is removed

nickm at torproject.org nickm at torproject.org
Tue May 30 12:51:29 UTC 2017


commit 334fe6bb6b124c2f3eb1186610999446d57cde76
Author: teor <teor2345 at gmail.com>
Date:   Sun May 28 22:16:00 2017 +1000

    Don't underflow usage when it is unknown and a file is removed
    
    Part of #22424.
---
 src/common/storagedir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/storagedir.c b/src/common/storagedir.c
index 9140ed2..532fa2a 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 {





More information about the tor-commits mailing list