fix: address correctness, safety, and concurrency issues (#2327)

Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
houseme
2026-03-30 00:30:57 +08:00
committed by GitHub
parent 860a37d3a8
commit 7172e151de
90 changed files with 20397 additions and 1228 deletions
+21 -10
View File
@@ -129,6 +129,7 @@ async fn run_legacy_bitrot_test_for_object(root: &std::path::Path, disk_name: &s
shard_size,
checksum_algo.clone(),
false,
false, // use_zero_copy
)
.await
{
@@ -186,16 +187,26 @@ async fn run_legacy_bitrot_test_for_object(root: &std::path::Path, disk_name: &s
};
let read_length = shard_size;
let mut reader =
match create_bitrot_reader(None, Some(&disk), bucket, &path, 0, read_length, shard_size, checksum_algo.clone(), false)
.await
{
Ok(Some(r)) => r,
_ => {
eprintln!("Failed to create bitrot reader for EC part: {:?}", part_path);
return false;
}
};
let mut reader = match create_bitrot_reader(
None,
Some(&disk),
bucket,
&path,
0,
read_length,
shard_size,
checksum_algo.clone(),
false,
false,
) // use_zero_copy
.await
{
Ok(Some(r)) => r,
_ => {
eprintln!("Failed to create bitrot reader for EC part: {:?}", part_path);
return false;
}
};
let mut buf = vec![0u8; shard_size];
match reader.read(&mut buf).await {