@@ -226,6 +226,27 @@ pub(crate) enum CorruptKind {
226
226
u32 ,
227
227
) ,
228
228
229
+ /// Journal size is invalid.
230
+ JournalSize ,
231
+
232
+ /// Journal magic is invalid.
233
+ JournalMagic ,
234
+
235
+ /// Journal superblock checksum is invalid.
236
+ JournalSuperblockChecksum ,
237
+
238
+ /// Journal block size does not match the filesystem block size.
239
+ JournalBlockSize ,
240
+
241
+ /// Journal does not have the expected number of blocks.
242
+ JournalTruncated ,
243
+
244
+ /// Journal first commit doesn't match the sequence number in the superblock.
245
+ JournalSequence ,
246
+
247
+ /// Journal has a descriptor block that contains no tag with the last-tag flag set.
248
+ JournalDescriptorBlockMissingLastTag ,
249
+
229
250
/// An inode's checksum is invalid.
230
251
InodeChecksum (
231
252
/// Inode number.
@@ -333,6 +354,30 @@ impl Display for CorruptKind {
333
354
f,
334
355
"invalid checksum for block group descriptor {block_group_num}"
335
356
) ,
357
+ Self :: JournalSize => {
358
+ write ! ( f, "journal size is invalid" )
359
+ }
360
+ Self :: JournalMagic => {
361
+ write ! ( f, "journal magic is invalid" )
362
+ }
363
+ Self :: JournalSuperblockChecksum => {
364
+ write ! ( f, "journal superblock checksum is invalid" )
365
+ }
366
+ Self :: JournalBlockSize => {
367
+ write ! (
368
+ f,
369
+ "journal block size does not match filesystem block size"
370
+ )
371
+ }
372
+ Self :: JournalTruncated => write ! ( f, "journal is truncated" ) ,
373
+ Self :: JournalSequence => write ! (
374
+ f,
375
+ "journal's first commit doesn't match the expected sequence"
376
+ ) ,
377
+ Self :: JournalDescriptorBlockMissingLastTag => write ! (
378
+ f,
379
+ "a journal descriptor block has no tag with the last-tag flag set"
380
+ ) ,
336
381
Self :: InodeChecksum ( inode) => {
337
382
write ! ( f, "invalid checksum for inode {inode}" )
338
383
}
@@ -450,6 +495,24 @@ pub enum Incompatible {
450
495
/// Inode number.
451
496
u32 ,
452
497
) ,
498
+
499
+ /// The journal superblock type is not supported.
500
+ JournalSuperblockType (
501
+ /// Raw journal block type.
502
+ u32 ,
503
+ ) ,
504
+
505
+ /// The journal checksum type is not supported.
506
+ JournalChecksumType (
507
+ /// Raw journal checksum type.
508
+ u8 ,
509
+ ) ,
510
+
511
+ /// The journal uses features not supported by this library.
512
+ JournalIncompatibleFeatures (
513
+ /// Raw feature bits.
514
+ u32 ,
515
+ ) ,
453
516
}
454
517
455
518
impl Display for Incompatible {
@@ -470,6 +533,15 @@ impl Display for Incompatible {
470
533
Self :: DirectoryEncrypted ( inode) => {
471
534
write ! ( f, "directory in inode {inode} is encrypted" )
472
535
}
536
+ Self :: JournalSuperblockType ( val) => {
537
+ write ! ( f, "journal superblock type is not supported: {val}" )
538
+ }
539
+ Self :: JournalChecksumType ( val) => {
540
+ write ! ( f, "journal checksum type is not supported: {val}" )
541
+ }
542
+ Self :: JournalIncompatibleFeatures ( val) => {
543
+ write ! ( f, "unsupported journal features: {val:08x}" )
544
+ }
473
545
}
474
546
}
475
547
}
0 commit comments