From 124b93f31c945f874c1dfc3141305c3e2f07a9bc Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 1 Oct 2020 11:00:23 +0200 Subject: [PATCH] upload_chunk: use block_in_place --- src/api2/backup/upload_chunk.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/api2/backup/upload_chunk.rs b/src/api2/backup/upload_chunk.rs index ec954721..cdd38c87 100644 --- a/src/api2/backup/upload_chunk.rs +++ b/src/api2/backup/upload_chunk.rs @@ -61,12 +61,15 @@ impl Future for UploadChunk { let (is_duplicate, compressed_size) = match proxmox::try_block! { let mut chunk = DataBlob::from_raw(raw_data)?; - chunk.verify_unencrypted(this.size as usize, &this.digest)?; + tools::runtime::block_in_place(|| { + chunk.verify_unencrypted(this.size as usize, &this.digest)?; - // always comput CRC at server side - chunk.set_crc(chunk.compute_crc()); + // always comput CRC at server side + chunk.set_crc(chunk.compute_crc()); + + this.store.insert_chunk(&chunk, &this.digest) + }) - this.store.insert_chunk(&chunk, &this.digest) } { Ok(res) => res, Err(err) => break err,