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 mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-12 14:30 UTC by Torsten
Modified: 2017-12-31 22:34 UTC (History)
0 users

See Also:


Attachments
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
Hello!

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
resolve.
3. mav@ has a more scalable solution offered here that's been
committed into CURRENT in the past couple months:
http://www.mail-archive.com/freebsd-stable@freebsd.org/msg107696.html
. Look for kern.cam.boot_delay.

HTH,
-Garrett
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