xfs: improve ondisk dquot flags checking
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 16 Jul 2020 01:39:51 +0000 (18:39 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 29 Jul 2020 03:24:14 +0000 (20:24 -0700)
commita990f7a84edc9941956ea3c1dfb89733c80f9ad0
tree6d1c7327bb9fd6d474a2149a859cdb8eb6d3610f
parent1a7ed271653a4f418a6398465f861ee795d34468
xfs: improve ondisk dquot flags checking

Create an XFS_DQTYPE_ANY mask for ondisk dquots flags, and use that to
ensure that we never accept any garbage flags when we're loading dquots.
While we're at it, restructure the quota type flag checking to use the
proper masking.

Note that I plan to add y2038 support soon, which will require a new
xfs_dqtype_t flag for extended timestamp support, hence all the work to
make the type masking work correctly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_dquot_buf.c
fs/xfs/libxfs/xfs_format.h