summaryrefslogtreecommitdiff
path: root/src/common/storagedir.c
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2017-05-28 22:16:00 +1000
committerteor <teor2345@gmail.com>2017-05-28 22:16:00 +1000
commit334fe6bb6b124c2f3eb1186610999446d57cde76 (patch)
tree516ea6581b8a7a84e1a17b2d972acefbc1b7d42a /src/common/storagedir.c
parent9e36b0beb9dc6fe02d43b4c217841c8164f41774 (diff)
downloadtor-334fe6bb6b124c2f3eb1186610999446d57cde76.tar.gz
tor-334fe6bb6b124c2f3eb1186610999446d57cde76.zip
Don't underflow usage when it is unknown and a file is removed
Part of #22424.
Diffstat (limited to 'src/common/storagedir.c')
-rw-r--r--src/common/storagedir.c2
1 files changed, 1 insertions, 1 deletions
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 {