MFC: 1.208
In devfs_first(), set mp->mnt_opt to a valid empty list of mount options instead of leaving it NULL. This eliminates a kernel panic when trying to do a mount -o update of /dev. Noticed by: cjsp Reviewed by: phk
This commit is contained in:
parent
cb88adac76
commit
6cfcaeedd1
@ -1245,6 +1245,7 @@ static void
|
|||||||
devfs_first(void)
|
devfs_first(void)
|
||||||
{
|
{
|
||||||
struct thread *td = curthread;
|
struct thread *td = curthread;
|
||||||
|
struct vfsoptlist *opts;
|
||||||
struct vfsconf *vfsp;
|
struct vfsconf *vfsp;
|
||||||
struct mount *mp = NULL;
|
struct mount *mp = NULL;
|
||||||
int error;
|
int error;
|
||||||
@ -1264,6 +1265,10 @@ devfs_first(void)
|
|||||||
if (error)
|
if (error)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
opts = malloc(sizeof(struct vfsoptlist), M_MOUNT, M_WAITOK);
|
||||||
|
TAILQ_INIT(opts);
|
||||||
|
mp->mnt_opt = opts;
|
||||||
|
|
||||||
mtx_lock(&mountlist_mtx);
|
mtx_lock(&mountlist_mtx);
|
||||||
TAILQ_INSERT_HEAD(&mountlist, mp, mnt_list);
|
TAILQ_INSERT_HEAD(&mountlist, mp, mnt_list);
|
||||||
mtx_unlock(&mountlist_mtx);
|
mtx_unlock(&mountlist_mtx);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user