Index: lib/geom/nop/gnop.8 =================================================================== --- lib/geom/nop/gnop.8 +++ lib/geom/nop/gnop.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2019 +.Dd December 3, 2019 .Dt GNOP 8 .Os .Sh NAME @@ -123,8 +123,8 @@ Additional options: .Bl -tag -width "-c count_until_fail" .It Fl c Ar count_until_fail -Specifies the number of I/O requests to allow before setting the read and write -failure probabilities to 100%. +Specifies the number of I/O requests to allow before setting the read, write and +delay failure probabilities. .It Fl d Ar delaymsec Specifies the delay of the requests in milliseconds. Note that requests will be delayed before they are sent to the backing device. Index: sys/geom/nop/g_nop.c =================================================================== --- sys/geom/nop/g_nop.c +++ sys/geom/nop/g_nop.c @@ -210,10 +210,6 @@ G_NOP_LOGREQ(bp, "Request received."); mtx_lock(&sc->sc_lock); - if (sc->sc_count_until_fail != 0 && --sc->sc_count_until_fail == 0) { - sc->sc_rfailprob = 100; - sc->sc_wfailprob = 100; - } switch (bp->bio_cmd) { case BIO_READ: sc->sc_reads++; @@ -260,7 +256,13 @@ sc->sc_cmd2s++; break; } + if (sc->sc_count_until_fail != 0 && --sc->sc_count_until_fail == 0) { + failprob = 0; + delayprob = 0; + delaytime = 0; + } mtx_unlock(&sc->sc_lock); + if (failprob > 0) { u_int rval;