diff options
author | dd <dd@FreeBSD.org> | 2001-08-07 19:23:16 +0000 |
---|---|---|
committer | dd <dd@FreeBSD.org> | 2001-08-07 19:23:16 +0000 |
commit | 045a8bbdf3d204f9af49aeba72bc5c7d309b57ec (patch) | |
tree | a89d9c90f75b5523685db7844d5fb94cba02cc76 /sbin/mdconfig | |
parent | b80b9bc08636427818bc7ee7ac20841643ad1025 (diff) | |
download | FreeBSD-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/mdconfig')
-rw-r--r-- | sbin/mdconfig/mdconfig.8 | 5 | ||||
-rw-r--r-- | sbin/mdconfig/mdconfig.c | 4 |
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")) |