xfs: enhance dinode verifier
authorEric Sandeen <sandeen@sandeen.net>
Tue, 17 Apr 2018 06:06:53 +0000 (23:06 -0700)
committerBastian Blank <waldi@debian.org>
Fri, 22 Jun 2018 09:50:22 +0000 (10:50 +0100)
commitd076a108fb8ccce39421ee33c25e9730f5961b9a
tree76b272a3f3a89f352a05588db88e344dfe66be82
parentdce0c4edfc927de05f44a528ec2821cb0d821630
xfs: enhance dinode verifier

Add several more validations to xfs_dinode_verify:

- For LOCAL data fork formats, di_nextents must be 0.
- For LOCAL attr fork formats, di_anextents must be 0.
- For inodes with no attr fork offset,
  - format must be XFS_DINODE_FMT_EXTENTS if set at all
  - di_anextents must be 0.

Thanks to dchinner for pointing out a couple related checks I had
forgotten to add.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199377
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name xfs-enhance-dinode-verifier.patch
fs/xfs/libxfs/xfs_inode_buf.c