Skip to content

Commit

Permalink
More journal work
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasbishop committed Jan 4, 2025
1 parent ebba762 commit d3d3c37
Show file tree
Hide file tree
Showing 5 changed files with 424 additions and 17 deletions.
33 changes: 33 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,24 @@ pub enum Corrupt {
u32,
),

/// Journal size is invalid.
JournalSize,

/// Journal magic is invalid.
JournalMagic,

/// Journal contains a block of unknown type.
JournalBlockType(
/// Raw block type.
u32,
),

/// Journal superblock type is invalid.
JournalSuperblockType(
/// Raw block type.
u32,
),

/// An inode's checksum is invalid.
InodeChecksum(
/// Inode number.
Expand Down Expand Up @@ -302,6 +320,21 @@ impl Display for Corrupt {
f,
"invalid checksum for block group descriptor {block_group_num}"
),
Self::JournalSize => {
write!(f, "journal size is invalid")
}
Self::JournalMagic => {
write!(f, "journal magic is invalid")
}
Self::JournalBlockType(block_type) => {
write!(
f,
"journal contains an unknown block type: {block_type}"
)
}
Self::JournalSuperblockType(block_type) => {
write!(f, "journal superblock type is invalid: {block_type}")
}
Self::InodeChecksum(inode) => {
write!(f, "invalid checksum for inode {inode}")
}
Expand Down
Loading

0 comments on commit d3d3c37

Please sign in to comment.