Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 222792
b: refs/heads/master
c: c76febe
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Alex Elder committed Dec 1, 2010
1 parent b495711 commit 5443e84
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: de25c1818c44f580ff556cb9e0f7a1c687ed870b
refs/heads/master: c76febef574fd86566bbdf1a73a547a439115c25
3 changes: 3 additions & 0 deletions trunk/fs/xfs/xfs_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ xfs_error_trap(int e)
int xfs_etest[XFS_NUM_INJECT_ERROR];
int64_t xfs_etest_fsid[XFS_NUM_INJECT_ERROR];
char * xfs_etest_fsname[XFS_NUM_INJECT_ERROR];
int xfs_error_test_active;

int
xfs_error_test(int error_tag, int *fsidp, char *expression,
Expand Down Expand Up @@ -108,6 +109,7 @@ xfs_errortag_add(int error_tag, xfs_mount_t *mp)
len = strlen(mp->m_fsname);
xfs_etest_fsname[i] = kmem_alloc(len + 1, KM_SLEEP);
strcpy(xfs_etest_fsname[i], mp->m_fsname);
xfs_error_test_active++;
return 0;
}
}
Expand Down Expand Up @@ -137,6 +139,7 @@ xfs_errortag_clearall(xfs_mount_t *mp, int loud)
xfs_etest_fsid[i] = 0LL;
kmem_free(xfs_etest_fsname[i]);
xfs_etest_fsname[i] = NULL;
xfs_error_test_active--;
}
}

Expand Down
5 changes: 3 additions & 2 deletions trunk/fs/xfs/xfs_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,14 @@ extern void xfs_corruption_error(const char *tag, int level,
#define XFS_RANDOM_BMAPIFORMAT XFS_RANDOM_DEFAULT

#ifdef DEBUG
extern int xfs_error_test_active;
extern int xfs_error_test(int, int *, char *, int, char *, unsigned long);

#define XFS_NUM_INJECT_ERROR 10
#define XFS_TEST_ERROR(expr, mp, tag, rf) \
((expr) || \
((expr) || (xfs_error_test_active && \
xfs_error_test((tag), (mp)->m_fixedfsid, "expr", __LINE__, __FILE__, \
(rf)))
(rf))))

extern int xfs_errortag_add(int error_tag, xfs_mount_t *mp);
extern int xfs_errortag_clearall(xfs_mount_t *mp, int loud);
Expand Down

0 comments on commit 5443e84

Please sign in to comment.