#[non_exhaustive]pub enum UfsError {
Truncated {
structure: &'static str,
need: usize,
have: usize,
},
BadMagic {
offset: usize,
bytes: [u8; 4],
le: u32,
be: u32,
},
BadCgMagic {
found: u32,
endian: Endian,
},
ImpossibleGeometry {
field: &'static str,
value: u64,
limit: u64,
},
InodeOutOfRange {
ino: u64,
count: u64,
},
}Expand description
Errors surfaced while parsing UFS/FFS 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 matched neither UFS1 (0x00011954) nor UFS2
(0x19540119) in either byte order.
Carries the four bytes actually found at the magic offset in both interpretations so the caller can identify what the image really is (fail-loud with the offending value).
Fields
BadCgMagic
A cylinder-group header’s magic did not match CG_MAGIC (0x00090255).
Carries the value found and the byte order used, so the caller sees the evidence rather than a bare “invalid cg”.
Fields
ImpossibleGeometry
A geometry field carried a value outside any sane bound for the image — consistent with corruption or an allocation-bomb. Names the field, the value, and the bound so the caller sees exactly what was rejected.
Fields
InodeOutOfRange
The requested inode number is past the filesystem’s inode count
(fs_ipg * fs_ncg), so it cannot address a real dinode. Carries the
requested number and the exclusive upper bound so the caller sees exactly
what was rejected (fail-loud with the offending value).
Trait Implementations§
impl Eq for UfsError
Source§impl Error for UfsError
impl Error for UfsError
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()