summaryrefslogtreecommitdiffstats
path: root/sbin/geom/class
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/geom/class')
-rw-r--r--sbin/geom/class/raid3/geom_raid3.c20
-rw-r--r--sbin/geom/class/raid3/graid3.825
2 files changed, 39 insertions, 6 deletions
diff --git a/sbin/geom/class/raid3/geom_raid3.c b/sbin/geom/class/raid3/geom_raid3.c
index c7120ed..8e507ec 100644
--- a/sbin/geom/class/raid3/geom_raid3.c
+++ b/sbin/geom/class/raid3/geom_raid3.c
@@ -60,6 +60,8 @@ struct g_command class_commands[] = {
{ 'n', "noautosync", NULL, G_TYPE_NONE },
{ 'r', "round_robin", NULL, G_TYPE_NONE },
{ 'R', "noround_robin", NULL, G_TYPE_NONE },
+ { 'w', "verify", NULL, G_TYPE_NONE },
+ { 'W', "noverify", NULL, G_TYPE_NONE },
G_OPT_SENTINEL
}
},
@@ -76,6 +78,7 @@ struct g_command class_commands[] = {
{ 'h', "hardcode", NULL, G_TYPE_NONE },
{ 'n', "noautosync", NULL, G_TYPE_NONE },
{ 'r', "round_robin", NULL, G_TYPE_NONE },
+ { 'w', "verify", NULL, G_TYPE_NONE },
G_OPT_SENTINEL
}
},
@@ -102,10 +105,10 @@ void
usage(const char *comm)
{
fprintf(stderr,
- "usage: %s label [-hnrv] name prov prov prov [prov [...]]\n"
+ "usage: %s label [-hnrvw] name prov prov prov [prov [...]]\n"
" %s clear [-v] prov [prov [...]]\n"
" %s dump prov [prov [...]]\n"
- " %s configure [-adhnrRv] name\n"
+ " %s configure [-adhnrRvwW] name\n"
" %s rebuild [-v] name prov\n"
" %s insert [-hv] <-n number> name prov\n"
" %s remove [-v] <-n number> name\n"
@@ -144,7 +147,7 @@ raid3_label(struct gctl_req *req)
u_char sector[512];
const char *str;
char param[16];
- int *hardcode, *nargs, *noautosync, *round_robin;
+ int *hardcode, *nargs, *noautosync, *round_robin, *verify;
int error, i;
unsigned sectorsize;
off_t mediasize;
@@ -195,6 +198,17 @@ raid3_label(struct gctl_req *req)
}
if (*round_robin)
md.md_mflags |= G_RAID3_DEVICE_FLAG_ROUND_ROBIN;
+ verify = gctl_get_paraml(req, "verify", sizeof(*verify));
+ if (verify == NULL) {
+ gctl_error(req, "No '%s' argument.", "verify");
+ return;
+ }
+ if (*verify)
+ md.md_mflags |= G_RAID3_DEVICE_FLAG_VERIFY;
+ if (*round_robin && *verify) {
+ gctl_error(req, "Both '%c' and '%c' options given.", 'r', 'w');
+ return;
+ }
hardcode = gctl_get_paraml(req, "hardcode", sizeof(*hardcode));
if (hardcode == NULL) {
gctl_error(req, "No '%s' argument.", "hardcode");
diff --git a/sbin/geom/class/raid3/graid3.8 b/sbin/geom/class/raid3/graid3.8
index 713f979..47a30f4 100644
--- a/sbin/geom/class/raid3/graid3.8
+++ b/sbin/geom/class/raid3/graid3.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd Aug 20, 2004
+.Dd Aug 22, 2004
.Dt GRAID3 8
.Os
.Sh NAME
@@ -33,7 +33,7 @@
.Sh SYNOPSIS
.Nm
.Cm label
-.Op Fl hnrv
+.Op Fl hnrvw
.Ar name
.Ar prov
.Ar prov
@@ -46,7 +46,7 @@
.Op Ar prov Op Ar ...
.Nm
.Cm configure
-.Op Fl adhnrRv
+.Op Fl adhnrRvwW
.Ar name
.Nm
.Cm rebuild
@@ -112,6 +112,21 @@ Without this option parity component is not used at all for reading operations
when device is in complete state.
With this option specified random I/O read operations are even 40% faster,
but sequential reads are slower.
+One cannot not use this options if
+.Fl w
+option is also specified.
+.It Fl w
+Use verify reading feature.
+When reading from device in complete state, read data also from parity component
+and verify the data by comparing XORed regular data with parity data.
+If verification fails,
+.Er EIO
+error is returned and value of sysctl
+.Va kern.geom.raid3.parity_mismatch
+is increased.
+One cannot not use this options if
+.Fl r
+option is also specified.
.El
.It Cm clear
Clear metadata on the given providers.
@@ -132,6 +147,10 @@ Turn off autosynchronization of stale components.
Turn on round-robin reading.
.It Fl R
Turn off round-robin reading.
+.It Fl w
+Turn on verify reading.
+.It Fl W
+Turn off verify reading.
.El
.It Cm rebuild
Rebuild the given component forcibly.
OpenPOWER on IntegriCloud