mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-03-20 07:58:55 +00:00
block: vhdx: Fix block size check
warning: boolean expression will never evaluate to 'true' --> block/src/vhdx/vhdx_metadata.rs:136:20 | 136 | if disk_spec.block_size < BLOCK_SIZE_MIN && disk_spec.block_size > BLOCK_SIZE_MAX { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: since `BLOCK_SIZE_MIN` < `BLOCK_SIZE_MAX`, the expression evaluates to false for any value of `disk_spec.block_size` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#impossible_comparisons = note: `#[warn(clippy::impossible_comparisons)]` on by default && was used when || should have been used Signed-off-by: Rob Bradford <rbradford@rivosinc.com> Signed-off-by: Bo Chen <chen.bo@intel.com> (cherry picked from commit b74907fa1b92ef587a71b48798c7764d3d934994)
This commit is contained in:
parent
46d59f0bc4
commit
5f04c9b6fe
@ -133,7 +133,7 @@ impl DiskSpec {
|
||||
.map_err(VhdxMetadataError::ReadMetadata)?;
|
||||
|
||||
// MUST be at least 1 MiB and not greater than 256 MiB
|
||||
if disk_spec.block_size < BLOCK_SIZE_MIN && disk_spec.block_size > BLOCK_SIZE_MAX {
|
||||
if disk_spec.block_size < BLOCK_SIZE_MIN || disk_spec.block_size > BLOCK_SIZE_MAX {
|
||||
return Err(VhdxMetadataError::InvalidBlockSize);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user