Przeglądaj źródła

Don't underflow usage when it is unknown and a file is removed

Part of #22424.
teor 7 lat temu
rodzic
commit
334fe6bb6b
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/common/storagedir.c

+ 1 - 1
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 {