From 27bd18f60eb2dfc79e473062b661d68b23262f14 Mon Sep 17 00:00:00 2001 From: weishu Date: Tue, 30 Jan 2024 22:34:33 +0800 Subject: [PATCH] ksud: fix potential slow copy --- userspace/ksud/src/event.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userspace/ksud/src/event.rs b/userspace/ksud/src/event.rs index 05de110a7a35..244827a6b0c8 100644 --- a/userspace/ksud/src/event.rs +++ b/userspace/ksud/src/event.rs @@ -246,7 +246,7 @@ pub fn on_boot_completed() -> Result<()> { // this is a update and we successfully booted if std::fs::rename(module_update_img, module_img).is_err() { warn!("Failed to rename images, copy it now.",); - std::fs::copy(module_update_img, module_img) + utils::copy_sparse_file(module_update_img, module_img) .with_context(|| "Failed to copy images")?; std::fs::remove_file(module_update_img).with_context(|| "Failed to remove image!")?; }