aboutsummaryrefslogtreecommitdiff
path: root/lib/geom
diff options
context:
space:
mode:
authorChuck Silvers <chs@FreeBSD.org>2019-09-13 23:03:56 +0000
committerChuck Silvers <chs@FreeBSD.org>2019-09-13 23:03:56 +0000
commit090a3ea3c27406bb902ce013ee2019bc7fda2319 (patch)
tree00e3a712e2ff8db05dc3d44c8dc84df4888ff70c /lib/geom
parentf8b45306c6c74938e248f9fbfc55499d2126a82f (diff)
downloadsrc-090a3ea3c27406bb902ce013ee2019bc7fda2319.tar.gz
src-090a3ea3c27406bb902ce013ee2019bc7fda2319.zip
Add a "count_until_fail" option to gnop, which says to start failing
I/O requests after the given number have been allowed though. Approved by: imp (mentor) Reviewed by: rpokala kib 0mp mckusick Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21593
Notes
Notes: svn path=/head/; revision=352312
Diffstat (limited to 'lib/geom')
-rw-r--r--lib/geom/nop/geom_nop.c14
-rw-r--r--lib/geom/nop/gnop.89
2 files changed, 16 insertions, 7 deletions
diff --git a/lib/geom/nop/geom_nop.c b/lib/geom/nop/geom_nop.c
index ea7afdce0ca0..346a721d3127 100644
--- a/lib/geom/nop/geom_nop.c
+++ b/lib/geom/nop/geom_nop.c
@@ -43,6 +43,7 @@ uint32_t version = G_NOP_VERSION;
struct g_command class_commands[] = {
{ "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL,
{
+ { 'c', "count_until_fail", "-1", G_TYPE_NUMBER },
{ 'd', "delaymsec", "-1", G_TYPE_NUMBER },
{ 'e', "error", "-1", G_TYPE_NUMBER },
{ 'o', "offset", "0", G_TYPE_NUMBER },
@@ -57,12 +58,14 @@ struct g_command class_commands[] = {
{ 'z', "physpath", G_NOP_PHYSPATH_PASSTHROUGH, G_TYPE_STRING },
G_OPT_SENTINEL
},
- "[-v] [-d delaymsec] [-e error] [-o offset] [-p stripesize] "
- "[-P stripeoffset] [-q rdelayprob] [-r rfailprob] [-s size] "
- "[-S secsize] [-w wfailprob] [-x wdelayprob] [-z physpath] dev ..."
+ "[-v] [-c count_until_fail] [-d delaymsec] [-e error] [-o offset] "
+ "[-p stripesize] [-P stripeoffset] [-q rdelayprob] [-r rfailprob] "
+ "[-s size] [-S secsize] [-w wfailprob] [-x wdelayprob] "
+ "[-z physpath] dev ..."
},
{ "configure", G_FLAG_VERBOSE, NULL,
{
+ { 'c', "count_until_fail", "-1", G_TYPE_NUMBER },
{ 'd', "delaymsec", "-1", G_TYPE_NUMBER },
{ 'e', "error", "-1", G_TYPE_NUMBER },
{ 'q', "rdelayprob", "-1", G_TYPE_NUMBER },
@@ -71,8 +74,9 @@ struct g_command class_commands[] = {
{ 'x', "wdelayprob", "-1", G_TYPE_NUMBER },
G_OPT_SENTINEL
},
- "[-v] [-d delaymsec] [-e error] [-q rdelayprob] [-r rfailprob] "
- "[-w wfailprob] [-x wdelayprob] prov ..."
+ "[-v] [-c count_until_fail] [-d delaymsec] [-e error] "
+ "[-q rdelayprob] [-r rfailprob] [-w wfailprob] [-x wdelayprob] "
+ "prov ..."
},
{ "destroy", G_FLAG_VERBOSE, NULL,
{
diff --git a/lib/geom/nop/gnop.8 b/lib/geom/nop/gnop.8
index ef6c44bc5297..12e609728566 100644
--- a/lib/geom/nop/gnop.8
+++ b/lib/geom/nop/gnop.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 31, 2019
+.Dd September 13, 2019
.Dt GNOP 8
.Os
.Sh NAME
@@ -34,6 +34,7 @@
.Nm
.Cm create
.Op Fl v
+.Op Fl c Ar count_until_fail
.Op Fl d Ar delaymsec
.Op Fl e Ar error
.Op Fl o Ar offset
@@ -50,6 +51,7 @@
.Nm
.Cm configure
.Op Fl v
+.Op Fl c Ar count_until_fail
.Op Fl d Ar delaymsec
.Op Fl e Ar error
.Op Fl q Ar rdelayprob
@@ -118,7 +120,10 @@ See
.El
.Pp
Additional options:
-.Bl -tag -width ".Fl r Ar rfailprob"
+.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%.
.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.