Skip to content

Commit

Permalink
xfs: ensure xfs_errortag_random_default matches XFS_ERRTAG_MAX
Browse files Browse the repository at this point in the history
commit b2c2974 upstream.

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>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Gao Xiang authored and gregkh committed Jul 7, 2022
1 parent da61388 commit f12968a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/xfs/xfs_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,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;

Expand Down

0 comments on commit f12968a

Please sign in to comment.