]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - scrub/disk.c
xfs_scrub: remove moveon from phase 2 functions
[thirdparty/xfsprogs-dev.git] / scrub / disk.c
index 214a534601ca6d1721f2342326c8db73fd09b2aa..a1ef798a02540fad7880c90a6699b12eefa24ff1 100644 (file)
@@ -22,6 +22,7 @@
 #include "xfs_scrub.h"
 #include "common.h"
 #include "disk.h"
+#include "platform_defs.h"
 
 #ifndef BLKROTATIONAL
 # define BLKROTATIONAL _IO(0x12, 126)
@@ -42,6 +43,7 @@ __disk_heads(
 {
        int                     iomin;
        int                     ioopt;
+       int                     nproc = platform_nproc();
        unsigned short          rot;
        int                     error;
 
@@ -303,6 +305,10 @@ disk_simulate_read_error(
                interval = strtoull(p, NULL, 10);
                interval &= ~((1U << disk->d_lbalog) - 1);
        }
+       if (interval <= 0) {
+               interval = -1;
+               return 0;
+       }
 
        /*
         * We simulate disk errors by pretending that there are media errors at