summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2011-11-08 10:18:07 +0000
committerattilio <attilio@FreeBSD.org>2011-11-08 10:18:07 +0000
commit8e918ec4392cb32837f42437c386d9dfb54b257c (patch)
treeaad727fea4dcc49faa4e9a9a2e7735212da7d6c5
parentc3fe1633d0da1a6ef3d16c2308160a9f52d6a464 (diff)
downloadFreeBSD-src-8e918ec4392cb32837f42437c386d9dfb54b257c.zip
FreeBSD-src-8e918ec4392cb32837f42437c386d9dfb54b257c.tar.gz
Introduce the option VFS_ALLOW_NONMPSAFE and turn it on by default on
all the architectures. The option allows to mount non-MPSAFE filesystem. Without it, the kernel will refuse to mount a non-MPSAFE filesytem. This patch is part of the effort of killing non-MPSAFE filesystems from the tree. No MFC is expected for this patch. Tested by: gianni Reviewed by: kib
-rw-r--r--UPDATING6
-rw-r--r--sys/amd64/conf/DEFAULTS3
-rw-r--r--sys/arm/conf/DEFAULTS2
-rw-r--r--sys/conf/NOTES3
-rw-r--r--sys/conf/options1
-rw-r--r--sys/i386/conf/DEFAULTS3
-rw-r--r--sys/ia64/conf/DEFAULTS3
-rw-r--r--sys/kern/vfs_mount.c15
-rw-r--r--sys/mips/conf/DEFAULTS2
-rw-r--r--sys/pc98/conf/DEFAULTS3
-rw-r--r--sys/powerpc/conf/DEFAULTS3
-rw-r--r--sys/sparc64/conf/DEFAULTS3
12 files changed, 47 insertions, 0 deletions
diff --git a/UPDATING b/UPDATING
index 1189f4c..dc17383 100644
--- a/UPDATING
+++ b/UPDATING
@@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW:
machines to maximize performance. (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
+20111108:
+ The option VFS_ALLOW_NONMPSAFE option has been added in order to
+ explicitely support non-MPSAFE filesystems.
+ It is on by default for all supported platform at this present
+ time.
+
20111101:
The broken amd(4) driver has been replaced with esp(4) in the amd64,
i386 and pc98 GENERIC kernel configuration files.
diff --git a/sys/amd64/conf/DEFAULTS b/sys/amd64/conf/DEFAULTS
index 2c221cb..e39a9e4 100644
--- a/sys/amd64/conf/DEFAULTS
+++ b/sys/amd64/conf/DEFAULTS
@@ -22,3 +22,6 @@ options GEOM_PART_EBR_COMPAT
options GEOM_PART_MBR
options NEW_PCIB
+
+# Allow mounting non-MPSAFE filesystems
+options VFS_ALLOW_NONMPSAFE
diff --git a/sys/arm/conf/DEFAULTS b/sys/arm/conf/DEFAULTS
index 591a0a1..3546d4e 100644
--- a/sys/arm/conf/DEFAULTS
+++ b/sys/arm/conf/DEFAULTS
@@ -9,3 +9,5 @@ device mem
options GEOM_PART_BSD
options GEOM_PART_MBR
+
+options VFS_ALLOW_NONMPSAFE
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 882d49c..a3d33c2a 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -1104,6 +1104,9 @@ options XFS
# unsuitable for inclusion on machines with untrusted local users.
options VFS_AIO
+# Enable mounting of non-MPSAFE filesystems.
+options VFS_ALLOW_NONMPSAFE
+
# Cryptographically secure random number generator; /dev/random
device random
diff --git a/sys/conf/options b/sys/conf/options
index 6ddecb8..61078bb 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -185,6 +185,7 @@ SYSVSHM opt_sysvipc.h
SW_WATCHDOG opt_watchdog.h
TURNSTILE_PROFILING
VFS_AIO
+VFS_ALLOW_NONMPSAFE
VERBOSE_SYSINIT opt_global.h
WLCACHE opt_wavelan.h
WLDEBUG opt_wavelan.h
diff --git a/sys/i386/conf/DEFAULTS b/sys/i386/conf/DEFAULTS
index 78d807c..1c5cd96 100644
--- a/sys/i386/conf/DEFAULTS
+++ b/sys/i386/conf/DEFAULTS
@@ -30,3 +30,6 @@ options NATIVE
device atpic
options NEW_PCIB
+
+# Allow mounting non-MPSAFE filesystems
+options VFS_ALLOW_NONMPSAFE
diff --git a/sys/ia64/conf/DEFAULTS b/sys/ia64/conf/DEFAULTS
index a3e10d6..e31e26b 100644
--- a/sys/ia64/conf/DEFAULTS
+++ b/sys/ia64/conf/DEFAULTS
@@ -20,3 +20,6 @@ options GEOM_PART_GPT
options GEOM_PART_MBR
options NEW_PCIB
+
+# Allow mounting non-MPSAFE filesystems
+options VFS_ALLOW_NONMPSAFE
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 545a183..873f425 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -37,6 +37,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_vfs_allow_nonmpsafe.h"
+
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
@@ -798,6 +800,14 @@ vfs_domount_first(
* get. No freeing of cn_pnbuf.
*/
error = VFS_MOUNT(mp);
+#ifndef VFS_ALLOW_NONMPSAFE
+ if (error == 0 && VFS_NEEDSGIANT(mp)) {
+ (void)VFS_UNMOUNT(mp, fsflags);
+ error = ENXIO;
+ printf("%s: Mounting non-MPSAFE fs (%s) is disabled\n",
+ __func__, mp->mnt_vfc->vfc_name);
+ }
+#endif
if (error != 0) {
vfs_unbusy(mp);
vfs_mount_destroy(mp);
@@ -807,6 +817,11 @@ vfs_domount_first(
vrele(vp);
return (error);
}
+#ifdef VFS_ALLOW_NONMPSAFE
+ if (VFS_NEEDSGIANT(mp))
+ printf("%s: Mounting non-MPSAFE fs (%s) is deprecated\n",
+ __func__, mp->mnt_vfc->vfc_name);
+#endif
if (mp->mnt_opt != NULL)
vfs_freeopts(mp->mnt_opt);
diff --git a/sys/mips/conf/DEFAULTS b/sys/mips/conf/DEFAULTS
index f09ef54..f015e89 100644
--- a/sys/mips/conf/DEFAULTS
+++ b/sys/mips/conf/DEFAULTS
@@ -9,3 +9,5 @@ device uart_ns8250
options GEOM_PART_BSD
options GEOM_PART_MBR
+
+options VFS_ALLOW_NONMPSAFE
diff --git a/sys/pc98/conf/DEFAULTS b/sys/pc98/conf/DEFAULTS
index 6c8b561..342a604 100644
--- a/sys/pc98/conf/DEFAULTS
+++ b/sys/pc98/conf/DEFAULTS
@@ -29,3 +29,6 @@ options GEOM_PART_PC98
device atpic
options NEW_PCIB
+
+# Allow mounting non-MPSAFE filesystems
+options VFS_ALLOW_NONMPSAFE
diff --git a/sys/powerpc/conf/DEFAULTS b/sys/powerpc/conf/DEFAULTS
index 658c221..54d1940 100644
--- a/sys/powerpc/conf/DEFAULTS
+++ b/sys/powerpc/conf/DEFAULTS
@@ -12,3 +12,6 @@ device uart_z8530
options GEOM_PART_APM
options GEOM_PART_MBR
+
+# Allow mounting non-MPSAFE filesystems
+options VFS_ALLOW_NONMPSAFE
diff --git a/sys/sparc64/conf/DEFAULTS b/sys/sparc64/conf/DEFAULTS
index c99480c..f1305a8 100644
--- a/sys/sparc64/conf/DEFAULTS
+++ b/sys/sparc64/conf/DEFAULTS
@@ -21,3 +21,6 @@ options GEOM_PART_VTOC8
options SUNKBD_EMULATE_ATKBD
options NEW_PCIB
+
+# Allow mounting non-MPSAFE filesystems
+options VFS_ALLOW_NONMPSAFE
OpenPOWER on IntegriCloud