summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-11-01 22:51:49 +0000
committerpjd <pjd@FreeBSD.org>2006-11-01 22:51:49 +0000
commitb34fb80d8364fbc4f1737da5f2916fe5b39a9325 (patch)
tree97b3734a2b0b5f3ef52ead534f66a992a2f04c67 /sbin
parent3d8e2e0a6f357ed1a3f49941041c5850215bb15d (diff)
downloadFreeBSD-src-b34fb80d8364fbc4f1737da5f2916fe5b39a9325.zip
FreeBSD-src-b34fb80d8364fbc4f1737da5f2916fe5b39a9325.tar.gz
Now, that we have gjournal in the tree add possibility to configure
gmirror and graid3 in a way that it is not resynchronized after a power failure or system crash. It is safe when gjournal is running on top of gmirror/graid3.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/geom/class/mirror/geom_mirror.c14
-rw-r--r--sbin/geom/class/mirror/gmirror.812
-rw-r--r--sbin/geom/class/raid3/geom_raid3.c15
-rw-r--r--sbin/geom/class/raid3/graid3.812
4 files changed, 39 insertions, 14 deletions
diff --git a/sbin/geom/class/mirror/geom_mirror.c b/sbin/geom/class/mirror/geom_mirror.c
index 0ace733..7fc01cd 100644
--- a/sbin/geom/class/mirror/geom_mirror.c
+++ b/sbin/geom/class/mirror/geom_mirror.c
@@ -67,12 +67,14 @@ struct g_command class_commands[] = {
{ 'a', "autosync", NULL, G_TYPE_BOOL },
{ 'b', "balance", configure_balance, G_TYPE_STRING },
{ 'd', "dynamic", NULL, G_TYPE_BOOL },
+ { 'f', "failsync", NULL, G_TYPE_BOOL },
+ { 'F', "nofailsync", NULL, G_TYPE_BOOL },
{ 'h', "hardcode", NULL, G_TYPE_BOOL },
{ 'n', "noautosync", NULL, G_TYPE_BOOL },
{ 's', "slice", &configure_slice, G_TYPE_NUMBER },
G_OPT_SENTINEL
},
- "[-adhnv] [-b balance] [-s slice] name"
+ "[-adfFhnv] [-b balance] [-s slice] name"
},
{ "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS,
"[-v] name prov ..."
@@ -86,12 +88,13 @@ struct g_command class_commands[] = {
{ "label", G_FLAG_VERBOSE, mirror_main,
{
{ 'b', "balance", label_balance, G_TYPE_STRING },
+ { 'F', "nofailsync", NULL, G_TYPE_BOOL },
{ 'h', "hardcode", NULL, G_TYPE_BOOL },
{ 'n', "noautosync", NULL, G_TYPE_BOOL },
{ 's', "slice", &label_slice, G_TYPE_NUMBER },
G_OPT_SENTINEL
},
- "[-hnv] [-b balance] [-s slice] name prov ..."
+ "[-Fhnv] [-b balance] [-s slice] name prov ..."
},
{ "insert", G_FLAG_VERBOSE, NULL,
{
@@ -154,7 +157,7 @@ mirror_label(struct gctl_req *req)
unsigned sectorsize;
off_t mediasize;
intmax_t val;
- int error, i, nargs, bal, hardcode, noautosync;
+ int error, i, nargs, bal, hardcode;
nargs = gctl_get_int(req, "nargs");
if (nargs < 2) {
@@ -182,9 +185,10 @@ mirror_label(struct gctl_req *req)
return;
}
md.md_balance = bal;
- noautosync = gctl_get_int(req, "noautosync");
- if (noautosync)
+ if (gctl_get_int(req, "noautosync"))
md.md_mflags |= G_MIRROR_DEVICE_FLAG_NOAUTOSYNC;
+ if (gctl_get_int(req, "nofailsync"))
+ md.md_mflags |= G_MIRROR_DEVICE_FLAG_NOFAILSYNC;
hardcode = gctl_get_int(req, "hardcode");
/*
diff --git a/sbin/geom/class/mirror/gmirror.8 b/sbin/geom/class/mirror/gmirror.8
index a58212c..4d62f72 100644
--- a/sbin/geom/class/mirror/gmirror.8
+++ b/sbin/geom/class/mirror/gmirror.8
@@ -33,7 +33,7 @@
.Sh SYNOPSIS
.Nm
.Cm label
-.Op Fl hnv
+.Op Fl Fhnv
.Op Fl b Ar balance
.Op Fl s Ar slice
.Ar name
@@ -44,7 +44,7 @@
.Ar prov ...
.Nm
.Cm configure
-.Op Fl adhnv
+.Op Fl adfFhnv
.Op Fl b Ar balance
.Op Fl s Ar slice
.Ar name
@@ -142,6 +142,9 @@ Split read requests, which are bigger than or equal to slice size on N pieces,
where N is the number of active components.
This is the default balance algorithm.
.El
+.It Fl F
+Do not synchronize after a power failure or system crash.
+Assumes device is in consistent state.
.It Fl h
Hardcode providers' names in metadata.
.It Fl n
@@ -167,6 +170,11 @@ Turn on autosynchronization of stale components.
Specifies balance algorithm to use.
.It Fl d
Do not hardcode providers' names in metadata.
+.It Fl f
+Synchronize device after a power failure or system crash.
+.It Fl F
+Do not synchronize after a power failure or system crash.
+Assumes device is in consistent state.
.It Fl h
Hardcode providers' names in metadata.
.It Fl n
diff --git a/sbin/geom/class/raid3/geom_raid3.c b/sbin/geom/class/raid3/geom_raid3.c
index 3f4df97..1bb41cb 100644
--- a/sbin/geom/class/raid3/geom_raid3.c
+++ b/sbin/geom/class/raid3/geom_raid3.c
@@ -58,6 +58,8 @@ struct g_command class_commands[] = {
{
{ 'a', "autosync", NULL, G_TYPE_BOOL },
{ 'd', "dynamic", NULL, G_TYPE_BOOL },
+ { 'f', "failsync", NULL, G_TYPE_BOOL },
+ { 'F', "nofailsync", NULL, G_TYPE_BOOL },
{ 'h', "hardcode", NULL, G_TYPE_BOOL },
{ 'n', "noautosync", NULL, G_TYPE_BOOL },
{ 'r', "round_robin", NULL, G_TYPE_BOOL },
@@ -66,7 +68,7 @@ struct g_command class_commands[] = {
{ 'W', "noverify", NULL, G_TYPE_BOOL },
G_OPT_SENTINEL
},
- "[-adhnrRvwW] name"
+ "[-adfFhnrRvwW] name"
},
{ "dump", 0, raid3_main, G_NULL_OPTS,
"prov ..."
@@ -82,12 +84,13 @@ struct g_command class_commands[] = {
{ "label", G_FLAG_VERBOSE, raid3_main,
{
{ 'h', "hardcode", NULL, G_TYPE_BOOL },
+ { 'F', "nofailsync", NULL, G_TYPE_BOOL },
{ 'n', "noautosync", NULL, G_TYPE_BOOL },
{ 'r', "round_robin", NULL, G_TYPE_BOOL },
{ 'w', "verify", NULL, G_TYPE_BOOL },
G_OPT_SENTINEL
},
- "[-hnrvw] name prov prov prov ..."
+ "[-hFnrvw] name prov prov prov ..."
},
{ "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS,
"[-v] name prov"
@@ -142,7 +145,8 @@ raid3_label(struct gctl_req *req)
const char *str;
unsigned sectorsize, ssize;
off_t mediasize, msize;
- int error, i, nargs, hardcode, noautosync, round_robin, verify;
+ int hardcode, round_robin, verify;
+ int error, i, nargs;
nargs = gctl_get_int(req, "nargs");
if (nargs < 4) {
@@ -165,9 +169,10 @@ raid3_label(struct gctl_req *req)
md.md_genid = 0;
md.md_syncid = 1;
md.md_sync_offset = 0;
- noautosync = gctl_get_int(req, "noautosync");
- if (noautosync)
+ if (gctl_get_int(req, "noautosync"))
md.md_mflags |= G_RAID3_DEVICE_FLAG_NOAUTOSYNC;
+ if (gctl_get_int(req, "nofailsync"))
+ md.md_mflags |= G_RAID3_DEVICE_FLAG_NOFAILSYNC;
round_robin = gctl_get_int(req, "round_robin");
if (round_robin)
md.md_mflags |= G_RAID3_DEVICE_FLAG_ROUND_ROBIN;
diff --git a/sbin/geom/class/raid3/graid3.8 b/sbin/geom/class/raid3/graid3.8
index b2da0bf..d9420b6 100644
--- a/sbin/geom/class/raid3/graid3.8
+++ b/sbin/geom/class/raid3/graid3.8
@@ -33,7 +33,7 @@
.Sh SYNOPSIS
.Nm
.Cm label
-.Op Fl hnrvw
+.Op Fl Fhnrvw
.Ar name
.Ar prov prov prov ...
.Nm
@@ -42,7 +42,7 @@
.Ar prov ...
.Nm
.Cm configure
-.Op Fl adhnrRvwW
+.Op Fl adfFhnrRvwW
.Ar name
.Nm
.Cm rebuild
@@ -97,6 +97,9 @@ The number of components must be equal to 3, 5, 9, 17, etc.\& (2^n + 1).
.Pp
Additional options include:
.Bl -tag -width ".Fl h"
+.It Fl F
+Do not synchronize after a power failure or system crash.
+Assumes device is in consistent state.
.It Fl h
Hardcode providers' names in metadata.
.It Fl n
@@ -134,6 +137,11 @@ Additional options include:
Turn on autosynchronization of stale components.
.It Fl d
Do not hardcode providers' names in metadata.
+.It Fl f
+Synchronize device after a power failure or system crash.
+.It Fl F
+Do not synchronize after a power failure or system crash.
+Assumes device is in consistent state.
.It Fl h
Hardcode providers' names in metadata.
.It Fl n
OpenPOWER on IntegriCloud