From: Gao Xiang Date: Mon, 22 Mar 2021 16:52:02 +0000 (-0700) Subject: xfs: ensure xfs_errortag_random_default matches XFS_ERRTAG_MAX X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b2c2974b8cdf1eb3ef90ff845eb27b19e2187b7e;p=linux.git 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 Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c index 185b4915b7bff..4d6509a61d112 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;