diff --git a/crates/ecstore/src/disk/local.rs b/crates/ecstore/src/disk/local.rs index 5fba72685..a7baa18b3 100644 --- a/crates/ecstore/src/disk/local.rs +++ b/crates/ecstore/src/disk/local.rs @@ -1179,14 +1179,9 @@ impl LocalDisk { f.write_all(buf).await.map_err(to_file_error)?; } InternalBuf::Owned(buf) => { - // Reduce one copy by using the owned buffer directly. - // It may be more efficient for larger writes. - let mut f = f.into_std().await; - let task = tokio::task::spawn_blocking(move || { - use std::io::Write as _; - f.write_all(buf.as_ref()).map_err(to_file_error) - }); - task.await??; + f.write_all(buf.as_ref()).await.map_err(to_file_error)?; + // Ensure write errors are observed before returning for owned buffers. + f.sync_all().await.map_err(to_file_error)?; } }