xfs: enhance dinode verifier
authorEric Sandeen <sandeen@sandeen.net>
Tue, 17 Apr 2018 06:06:53 +0000 (23:06 -0700)
committerSalvatore Bonaccorso <carnil@debian.org>
Sun, 27 May 2018 12:05:03 +0000 (13:05 +0100)
commit143cf886a4edeca07bde4e36250320c9043326ec
treee0489e1b9b4c26c972f8bd5692ed40103e5f4d3b
parent59ef6283835316c2d928cc942d16bf68c47579eb
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