On Wed, Mar 10, 2021 at 02:42:05AM +0800, Gao Xiang wrote: > From: Gao Xiang <hsiangkao@xxxxxxxxxx> > > 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@xxxxxxxxxx> Yay! Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx> --D > --- > fs/xfs/xfs_error.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c > index 185b4915b7bf..82425c9a623d 100644 > --- a/fs/xfs/xfs_error.c > +++ b/fs/xfs/xfs_error.c > @@ -299,6 +299,7 @@ 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; > > -- > 2.20.1 >