mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-21 11:56:38 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user