1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-13 14:40:22 +00:00

If floppies are used to boot the machine, the user lets the machine

complete the boot and enter into sysinstall, and only then inserts
a CD into the CDROM drive and tries to select that as the install
media the first call to mount(2) generates EIO but the second call
to mount(2) will succeed.  This was 100% reproducible on 6.2-RELEASE,
RELENG_6, and HEAD.  If the user inserts the disc into the CDROM
while the machine is booting off the floppies the first call to mount(2)
succeeds with no problems.  The problem was originally reported in
PR #56952 against 5.1-CURRENT so it's been there for a while now.

PR:		bin/56952
MFC after:	2 weeks
This commit is contained in:
Ken Smith 2007-02-22 20:29:53 +00:00
parent e739933759
commit 10fa77a3a9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166893

View File

@ -80,6 +80,7 @@ mediaInitCDROM(Device *dev)
char *cp = NULL;
Boolean readInfo = TRUE;
static Boolean bogusCDOK = FALSE;
int err;
if (cdromMounted)
return TRUE;
@ -88,7 +89,11 @@ mediaInitCDROM(Device *dev)
bzero(&args, sizeof(args));
args.fspec = dev->devname;
args.flags = 0;
if (mount("cd9660", mountpoint, MNT_RDONLY, (caddr_t) &args) == -1) {
err = mount("cd9660", mountpoint, MNT_RDONLY, (caddr_t) &args);
/* If disc inserted too recently first access generates EIO, try again */
if (err == -1 && errno == EIO)
err = mount("cd9660", mountpoint, MNT_RDONLY, (caddr_t) &args);
if (err == -1) {
if (errno == EINVAL) {
msgConfirm("The disc in your drive looks more like an Audio disc than a FreeBSD release.");
return FALSE;