Please don't reply to lustre-devel. Instead, comment in Bugzilla by using the 
following link:
https://bugzilla.lustre.org/show_bug.cgi?id=11324



(From update of attachment 9373)
>+static int __ext4_ext_check_header(const char *function, struct inode *inode,
>+                                      struct ext4_extent_header *eh,
>+                                      int depth)
>+{
>+      const char *error_msg = NULL;
>+      int max = 0;
>+
>+      if (unlikely(eh->eh_magic != EXT4_EXT_MAGIC)) {
>+              error_msg = "invalid magic";
>+              goto corrupted;
>+      }
>+      if (unlikely(le16_to_cpu(eh->eh_depth) != depth)) {
>+              error_msg = "unexpected eh_depth";
>+              goto corrupted;
>+      }

Could we change this to allow eh->eh_depth <= depth?  That would allow e2fsck
more leeway in fixing up extent corruptions, instead of having to do a full
tree rebalance.

>+      max = ext4_ext_max_entries(inode, depth);
>+      if (unlikely(le16_to_cpu(eh->eh_max) > max)) {
>+              error_msg = "too large eh_max";
>+              goto corrupted;
>+      }

In e2fsck I also check if eh->eh_max < max - 2.  This allows up to 2 items at
the end of the block for e.g. ext3_extent_tail to hold inum+gen+checksum, and
possibly another extension.

_______________________________________________
Lustre-devel mailing list
[email protected]
https://mail.clusterfs.com/mailman/listinfo/lustre-devel

Reply via email to