|
@@ -466,6 +466,8 @@ xfs_dinode_verify(
|
|
|
return __this_address;
|
|
|
if (di_size > XFS_DFORK_DSIZE(dip, mp))
|
|
|
return __this_address;
|
|
|
+ if (dip->di_nextents)
|
|
|
+ return __this_address;
|
|
|
/* fall through */
|
|
|
case XFS_DINODE_FMT_EXTENTS:
|
|
|
case XFS_DINODE_FMT_BTREE:
|
|
@@ -484,12 +486,31 @@ xfs_dinode_verify(
|
|
|
if (XFS_DFORK_Q(dip)) {
|
|
|
switch (dip->di_aformat) {
|
|
|
case XFS_DINODE_FMT_LOCAL:
|
|
|
+ if (dip->di_anextents)
|
|
|
+ return __this_address;
|
|
|
+ /* fall through */
|
|
|
case XFS_DINODE_FMT_EXTENTS:
|
|
|
case XFS_DINODE_FMT_BTREE:
|
|
|
break;
|
|
|
default:
|
|
|
return __this_address;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ /*
|
|
|
+ * If there is no fork offset, this may be a freshly-made inode
|
|
|
+ * in a new disk cluster, in which case di_aformat is zeroed.
|
|
|
+ * Otherwise, such an inode must be in EXTENTS format; this goes
|
|
|
+ * for freed inodes as well.
|
|
|
+ */
|
|
|
+ switch (dip->di_aformat) {
|
|
|
+ case 0:
|
|
|
+ case XFS_DINODE_FMT_EXTENTS:
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ return __this_address;
|
|
|
+ }
|
|
|
+ if (dip->di_anextents)
|
|
|
+ return __this_address;
|
|
|
}
|
|
|
|
|
|
/* only version 3 or greater inodes are extensively verified here */
|