Subject: bin/15235: init's mount_mfs call fails to reserve sufficient inodes
To: None <>
From: None <>
List: netbsd-bugs
Date: 01/13/2002 09:23:38
>Number:         15235
>Category:       bin
>Synopsis:       init's mount_mfs call fails to reserve sufficient inodes
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 13 09:24:00 PST 2002
>Originator:     Gavan Fantom
>Release:        NetBSD 1.5.2 on i386
If the root filesystem is an MSDOS filesystem and /dev/console is not present, init will create an mfs on /dev and run MAKEDEV all. The mfs which it creates is no longer big enough to contain that which MAKEDEV all creates on i386.
Boot a PC running NetBSD 1.5.2 with root on an msdos filesystem and no /dev/console, and watch a pile of filesystem full errors appear. Observe that although /dev/console is created, no ttyE* files are created.

The attached fix, tested on i386, creates enough inodes for the MAKEDEV in 1.5.2, leaving 22 inodes spare.
The patch looks like this, although cut&paste into a browser won't preserve tabs :(

--- init.c.orig Sun Jan 13 17:19:20 2002
+++ init.c      Sun Jan 13 17:19:44 2002
@@ -1398,8 +1398,8 @@
        /* Mount an mfs over /dev so we can create devices */
        switch ((pid = fork())) {
        case 0:
-               (void) execl("/sbin/mount_mfs", "mount_mfs", "-i", "256",
-                   "-s", "384", "-b", "4096", "-f", "512", "swap", "/dev",
+               (void) execl("/sbin/mount_mfs", "mount_mfs", "-i", "192",
+                   "-s", "512", "-b", "4096", "-f", "512", "swap", "/dev",
                goto done;