mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-20 11:11:24 +00:00
Don't try to load KLDs if we're mounting the root. We'd otherwise panic.
Tested by: kris MFC after: 3 days
This commit is contained in:
parent
7f9f1e422f
commit
c270875f7c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154962
@ -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 ||
|
||||
|
Loading…
Reference in New Issue
Block a user