summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/vfs_mount.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 4b57575..2015a43 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -818,10 +818,18 @@ vfs_domount(
vput(vp);
return (ENOTDIR);
}
- vfsp = vfs_byname_kld(fstype, td, &error);
- if (vfsp == NULL) {
- vput(vp);
- return (error);
+ /* Don't try to load KLDs if we're mounting the root. */
+ if (fsflags & MNT_ROOTFS) {
+ if ((vfsp = vfs_byname(fstype)) == NULL) {
+ vput(vp);
+ return (ENODEV);
+ }
+ } else {
+ vfsp = vfs_byname_kld(fstype, td, &error);
+ if (vfsp == NULL) {
+ vput(vp);
+ return (error);
+ }
}
VI_LOCK(vp);
if ((vp->v_iflag & VI_MOUNT) != 0 ||
OpenPOWER on IntegriCloud