summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authordd <dd@FreeBSD.org>2001-08-07 19:23:16 +0000
committerdd <dd@FreeBSD.org>2001-08-07 19:23:16 +0000
commit045a8bbdf3d204f9af49aeba72bc5c7d309b57ec (patch)
treea89d9c90f75b5523685db7844d5fb94cba02cc76 /sbin
parentb80b9bc08636427818bc7ee7ac20841643ad1025 (diff)
downloadFreeBSD-src-045a8bbdf3d204f9af49aeba72bc5c7d309b57ec.zip
FreeBSD-src-045a8bbdf3d204f9af49aeba72bc5c7d309b57ec.tar.gz
Introduce a force option, MD_FORCE, that instructs the driver to
bypass some extra anti-foot-shooting measures. Currently, its only effect is to allow detaching a device while it's still open (e.g., mounted). This is useful for testing how the system reacts to a disk suddenly going away, which can happen with some removeable media. At this point, the force option is only checked on detach, so it would've been possible to allow the option to be passed with the MDIOCDETACH operation. This was not done to allow the possibility of having the force flag influence other tests in the future, which may not necessarily deal with detaching the device. Reviewed by: sobomax Approved by: phk
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mdconfig/mdconfig.85
-rw-r--r--sbin/mdconfig/mdconfig.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/sbin/mdconfig/mdconfig.8 b/sbin/mdconfig/mdconfig.8
index 6ed7e8a..9226fbe 100644
--- a/sbin/mdconfig/mdconfig.8
+++ b/sbin/mdconfig/mdconfig.8
@@ -129,6 +129,11 @@ Enable clustering on this disk.
.Xc
Enable/Disable compression features to reduce memory usage.
.It Xo
+.Oo Cm no Oc Ns Cm force
+.Xc
+Disable/Enable extra sanity checks to prevent the user from doing something
+that might adversely affect the system.
+.It Xo
.Oo Cm no Oc Ns Cm readonly
.Xc
Enable/Disable readonly mode.
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c
index 53d0480..3b2d642 100644
--- a/sbin/mdconfig/mdconfig.c
+++ b/sbin/mdconfig/mdconfig.c
@@ -120,6 +120,10 @@ main(int argc, char **argv)
mdio.md_options |= MD_COMPRESS;
else if (!strcmp(optarg, "nocompress"))
mdio.md_options &= ~MD_COMPRESS;
+ else if (!strcmp(optarg, "force"))
+ mdio.md_options |= MD_FORCE;
+ else if (!strcmp(optarg, "noforce"))
+ mdio.md_options &= ~MD_FORCE;
else if (!strcmp(optarg, "reserve"))
mdio.md_options |= MD_RESERVE;
else if (!strcmp(optarg, "noreserve"))
OpenPOWER on IntegriCloud