#[non_exhaustive]pub enum BtrfsError {
Truncated {
structure: &'static str,
need: usize,
have: usize,
},
BadMagic {
bytes: [u8; 8],
},
AllocationBomb {
field: &'static str,
claimed: u64,
bound: u64,
},
}Expand description
Errors surfaced while parsing btrfs on-disk structures.
Every variant names the offending value so an “unknown/invalid” report hands the investigator the evidence (raw bytes / offset), never a bare “invalid”.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Truncated
The buffer was too small to hold the structure being parsed.
Fields
BadMagic
The superblock magic did not match _BHRfS_M at offset 0x40.
Carries the eight bytes actually found so the caller can identify what the image really is (fail-loud with the offending value).
AllocationBomb
A length/size field from the untrusted image demanded an allocation far larger than the image itself could justify — a classic allocation-bomb.
Carries the offending value and the bound it exceeded so the report hands the investigator the evidence, never a bare “too big” (fail-loud).
Trait Implementations§
Source§impl Debug for BtrfsError
impl Debug for BtrfsError
Source§impl Display for BtrfsError
impl Display for BtrfsError
impl Eq for BtrfsError
Source§impl Error for BtrfsError
impl Error for BtrfsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()