[pbs-devel] applied: [PATCH backup] datastore: gc: avoid unsafe call into libc, use epoch_i64 helper

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Oct 1 12:39:41 CEST 2020


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/backup/datastore.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backup/datastore.rs b/src/backup/datastore.rs
index f23a8517..1b5f7f8a 100644
--- a/src/backup/datastore.rs
+++ b/src/backup/datastore.rs
@@ -483,7 +483,7 @@ impl DataStore {
             // writer" information and thus no safe atime cutoff
             let _exclusive_lock =  self.chunk_store.try_exclusive_lock()?;
 
-            let phase1_start_time = unsafe { libc::time(std::ptr::null_mut()) };
+            let phase1_start_time = proxmox::tools::time::epoch_i64();
             let oldest_writer = self.chunk_store.oldest_writer().unwrap_or(phase1_start_time);
 
             let mut gc_status = GarbageCollectionStatus::default();
-- 
2.27.0






More information about the pbs-devel mailing list