]> git.proxmox.com Git - proxmox-backup.git/commitdiff
backup/datastore: count still bad chunks for the status
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 23 Oct 2020 14:32:31 +0000 (16:32 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 27 Oct 2020 16:41:30 +0000 (17:41 +0100)
we want to show the user that there are still bad chunks after a garbage
collection

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/api2/types/mod.rs
src/backup/chunk_store.rs

index f97db55712cc95ade3bd5e0f648a132dc2b7e284..1b9a305ff6f422b0eee36201c441b4ed38bc4b57 100644 (file)
@@ -587,6 +587,8 @@ pub struct GarbageCollectionStatus {
     pub pending_chunks: usize,
     /// Number of chunks marked as .bad by verify that have been removed by GC.
     pub removed_bad: usize,
+    /// Number of chunks still marked as .bad after garbage collection.
+    pub still_bad: usize,
 }
 
 impl Default for GarbageCollectionStatus {
@@ -602,6 +604,7 @@ impl Default for GarbageCollectionStatus {
             pending_bytes: 0,
             pending_chunks: 0,
             removed_bad: 0,
+            still_bad: 0,
         }
     }
 }
index 96c46efbb472ef1957b4105126b28dc6f0eb2afa..b7556f8a8349bc5e7b4e15a31adf547a275375ce 100644 (file)
@@ -354,9 +354,11 @@ impl ChunkStore {
                         },
                         Err(nix::Error::Sys(nix::errno::Errno::ENOENT)) => {
                             // chunk hasn't been rewritten yet, keep .bad file
+                            status.still_bad += 1;
                         },
                         Err(err) => {
                             // some other error, warn user and keep .bad file around too
+                            status.still_bad += 1;
                             crate::task_warn!(
                                 worker,
                                 "error during stat on '{:?}' - {}",