mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
linux/xfs_fs.h
Turn off ERROR_INJECT_DISABLE (or turn on error injection).
This commit is contained in:
+1
-10
@@ -32,8 +32,6 @@
|
|||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
/* XXX temporary hack - error injection is disabled */
|
|
||||||
#define ERROR_INJECT_DISABLE
|
|
||||||
#define XFS_ERRTAG_MAX 17
|
#define XFS_ERRTAG_MAX 17
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -384,13 +382,9 @@ int main(int argc, char **argv)
|
|||||||
errtag += (random() % (XFS_ERRTAG_MAX - errtag));
|
errtag += (random() % (XFS_ERRTAG_MAX - errtag));
|
||||||
}
|
}
|
||||||
printf("Injecting failure on tag #%d\n", errtag);
|
printf("Injecting failure on tag #%d\n", errtag);
|
||||||
#ifndef ERROR_INJECT_DISABLE
|
|
||||||
err_inj.errtag = errtag;
|
err_inj.errtag = errtag;
|
||||||
err_inj.fd = fd;
|
err_inj.fd = fd;
|
||||||
srval = ioctl(fd, XFS_IOC_ERROR_INJECTION, &err_inj);
|
srval = ioctl(fd, XFS_IOC_ERROR_INJECTION, &err_inj);
|
||||||
#else
|
|
||||||
srval = -1;
|
|
||||||
#endif
|
|
||||||
if (srval < -1) {
|
if (srval < -1) {
|
||||||
perror("fsstress - XFS_SYSSGI error injection call");
|
perror("fsstress - XFS_SYSSGI error injection call");
|
||||||
close(fd);
|
close(fd);
|
||||||
@@ -410,13 +404,10 @@ int main(int argc, char **argv)
|
|||||||
while (wait(&stat) > 0)
|
while (wait(&stat) > 0)
|
||||||
continue;
|
continue;
|
||||||
if (errtag != 0) {
|
if (errtag != 0) {
|
||||||
#ifndef ERROR_INJECT_DISABLE
|
|
||||||
err_inj.errtag = 0;
|
err_inj.errtag = 0;
|
||||||
err_inj.fd = fd;
|
err_inj.fd = fd;
|
||||||
if((srval = ioctl(fd, XFS_IOC_ERROR_CLEARALL, &err_inj)) != 0) {
|
if((srval = ioctl(fd, XFS_IOC_ERROR_CLEARALL, &err_inj)) != 0) {
|
||||||
#else
|
fprintf(stderr, "Bad ej clear on %d (%d).\n", fd, errno);
|
||||||
if (1) {
|
|
||||||
#endif
|
|
||||||
perror("fsstress - XFS_SYSSGI clear error injection call");
|
perror("fsstress - XFS_SYSSGI clear error injection call");
|
||||||
close(fd);
|
close(fd);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user