summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_format.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-07-16 04:39:51 +0300
committerDarrick J. Wong <darrick.wong@oracle.com>2020-07-29 06:24:14 +0300
commita990f7a84edc9941956ea3c1dfb89733c80f9ad0 (patch)
tree6d1c7327bb9fd6d474a2149a859cdb8eb6d3610f /fs/xfs/libxfs/xfs_format.h
parent1a7ed271653a4f418a6398465f861ee795d34468 (diff)
downloadlinux-a990f7a84edc9941956ea3c1dfb89733c80f9ad0.tar.xz
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>
Diffstat (limited to 'fs/xfs/libxfs/xfs_format.h')
-rw-r--r--fs/xfs/libxfs/xfs_format.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
index 0fa969f6202c..29564bd32bef 100644
--- a/fs/xfs/libxfs/xfs_format.h
+++ b/fs/xfs/libxfs/xfs_format.h
@@ -1158,6 +1158,8 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
XFS_DQTYPE_PROJ | \
XFS_DQTYPE_GROUP)
+#define XFS_DQTYPE_ANY (XFS_DQTYPE_REC_MASK)
+
/*
* This is the main portion of the on-disk representation of quota information
* for a user. We pad this with some more expansion room to construct the on