summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_error.c
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@redhat.com>2021-03-22 09:52:02 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-03-25 16:47:50 -0700
commitb2c2974b8cdf1eb3ef90ff845eb27b19e2187b7e (patch)
tree3ba954d0de2a9f6dfc5fce9f536fce76e94b4a09 /fs/xfs/xfs_error.c
parent92cf7d36384b99d5a57bf4422904a3c16dc4527a (diff)
downloadlinux-b2c2974b8cdf1eb3ef90ff845eb27b19e2187b7e.tar.bz2
xfs: ensure xfs_errortag_random_default matches XFS_ERRTAG_MAX
Add the BUILD_BUG_ON to xfs_errortag_add() in order to make sure that the length of xfs_errortag_random_default matches XFS_ERRTAG_MAX when building. Signed-off-by: Gao Xiang <hsiangkao@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_error.c')
-rw-r--r--fs/xfs/xfs_error.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
index 185b4915b7bf..4d6509a61d11 100644
--- a/fs/xfs/xfs_error.c
+++ b/fs/xfs/xfs_error.c
@@ -299,6 +299,8 @@ xfs_errortag_add(
struct xfs_mount *mp,
unsigned int error_tag)
{
+ BUILD_BUG_ON(ARRAY_SIZE(xfs_errortag_random_default) != XFS_ERRTAG_MAX);
+
if (error_tag >= XFS_ERRTAG_MAX)
return -EINVAL;