Bug 144695 - [vfs] [patch] race condition in mounting a root-fs on an external usb-disk
Summary: [vfs] [patch] race condition in mounting a root-fs on an external usb-disk
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2010-03-12 14:30 UTC by Torsten
Modified: 2017-12-31 22:34 UTC (History)
0 users

See Also:

file.diff (628 bytes, patch)
2010-03-12 14:30 UTC, Torsten
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Torsten 2010-03-12 14:30:03 UTC

I have installed FreeBSD 8 on my external usb-harddisk without any problems. Just I cannot boot into it, but I always receive a mountroot-prompt. 
Reading the news / archives I found a problem in the mountroot taking place too early -- before all of the usb-probe and device-setup is fully done.
There was (?) no really solution available, so I have made a small change that caused everything to work -- but one may see this more a work-around than rather a real fix.
The main idea is to put in an un-conditional wait at the beginning of vfs_mountroot. And, of course make this configurable. The acutal change is just a few lines that should not harm anything else. 
For my system I have started with the default of 5000ms, but I needed to go to 15000ms to mount my root-fs safely.
Please find attached the source-diff.

Fix: FreeBSD unixrest 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Fri Mar 12 14:02:27 CET 2010     root@unixrest:/usr/src/sys/i386/compile/BXGENERIC  i386

Patch attached with submission follows:
Comment 1 Garrett Cooper 2010-03-12 22:18:44 UTC
1. This was misfiled (should be under kern).
2. This is a well-known issue (devices in general not being available
by the time mount of mountroot is attempted) that isn't trivial to
3. mav@ has a more scalable solution offered here that's been
committed into CURRENT in the past couple months:
. Look for kern.cam.boot_delay.

Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:04 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped