Commit fbc21f33 authored by Dan Carpenter's avatar Dan Carpenter Committed by Dave Chinner

xfs: don't allow negative error tags

Errors go from zero which means no error to XFS_ERRTAG_MAX (22).  My
static checker complains that xfs_errortag_add() puts an upper bound on
this but not a lower bound.  Let's fix it by making it unsigned.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 7f1b6245
...@@ -55,7 +55,7 @@ xfs_error_test(int error_tag, int *fsidp, char *expression, ...@@ -55,7 +55,7 @@ xfs_error_test(int error_tag, int *fsidp, char *expression,
} }
int int
xfs_errortag_add(int error_tag, xfs_mount_t *mp) xfs_errortag_add(unsigned int error_tag, xfs_mount_t *mp)
{ {
int i; int i;
int len; int len;
......
...@@ -128,7 +128,7 @@ extern int xfs_error_test(int, int *, char *, int, char *, unsigned long); ...@@ -128,7 +128,7 @@ extern int xfs_error_test(int, int *, char *, int, char *, unsigned long);
xfs_error_test((tag), (mp)->m_fixedfsid, "expr", __LINE__, __FILE__, \ xfs_error_test((tag), (mp)->m_fixedfsid, "expr", __LINE__, __FILE__, \
(rf)))) (rf))))
extern int xfs_errortag_add(int error_tag, struct xfs_mount *mp); extern int xfs_errortag_add(unsigned int error_tag, struct xfs_mount *mp);
extern int xfs_errortag_clearall(struct xfs_mount *mp, int loud); extern int xfs_errortag_clearall(struct xfs_mount *mp, int loud);
#else #else
#define XFS_TEST_ERROR(expr, mp, tag, rf) (expr) #define XFS_TEST_ERROR(expr, mp, tag, rf) (expr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment