[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 334fe6bb6b124c2f3eb1186610999446d57cde76
Author: teor <teor2345@xxxxxxxxx>
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 {



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits