]> git.proxmox.com Git - proxmox-backup.git/commitdiff
upload_chunk: use block_in_place
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 1 Oct 2020 09:00:23 +0000 (11:00 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 1 Oct 2020 09:00:23 +0000 (11:00 +0200)
src/api2/backup/upload_chunk.rs

index ec954721beb58ee0734eaa78100749ce37a8cc73..cdd38c87e41bfb1eef997ba60de91ff91d4db9ae 100644 (file)
@@ -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,