Date: Sat, 5 Dec 1998 17:06:54 +0000 (GMT) From: Andrew Gordon <arg@arg1.demon.co.uk> To: stable@FreeBSD.ORG Subject: Problem with CD9660 root on -stable Message-ID: <Pine.BSF.3.96.981205163230.5450A-200000@server.arg.sj.co.uk>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
I've been playing with CD root filesystem ('-C' at the boot prompt). All
seems to be OK on SCSI systems, within the limited scope of my testing.
However, using an IDE/ATAPI CDROM fails to mount the root filesystem.
Having traced this a bit, I find that iso_get_ssector() [in
sys/isofs/cd9660/cd9660_vfsops.c] is returning bogus results; my immediate
problem can be fixed by hacking it to return zero always (disabling
support for multi-session CDROMs).
Digging a little deeper, it appears that the wdc driver implements
CDIOREADTOCENTRYS but not the related CDIOREADTOCENTRY that is needed by
iso_get_ssector(). This should still be OK - iso_get_sector() traps the
error and simply assumes a single-session CD in this case - but
unfortunately the error test is wrong (because it is calling the driver's
ioctl entry point directly, the return value is zero or an errno value).
The enclosed patch fixes the problem.
[-- Attachment #2 --]
Index: isofs/cd9660/cd9660_vfsops.c
===================================================================
RCS file: /current/repository/src/sys/isofs/cd9660/cd9660_vfsops.c,v
retrieving revision 1.15.4.2
diff -c -r1.15.4.2 cd9660_vfsops.c
*** cd9660_vfsops.c 1998/01/02 16:46:15 1.15.4.2
--- cd9660_vfsops.c 1998/12/05 17:04:06
***************
*** 125,137 ****
if (ioctlp == NULL)
return 0;
! if (ioctlp(dev, CDIOREADTOCHEADER, (caddr_t)&h, FREAD, p) == -1)
return 0;
for (i = h.ending_track; i >= 0; i--) {
t.address_format = CD_LBA_FORMAT;
t.track = i;
! if (ioctlp(dev, CDIOREADTOCENTRY, (caddr_t)&t, FREAD, p) == -1)
return 0;
if ((t.entry.control & 4) != 0)
/* found a data track */
--- 125,137 ----
if (ioctlp == NULL)
return 0;
! if (ioctlp(dev, CDIOREADTOCHEADER, (caddr_t)&h, FREAD, p) != 0)
return 0;
for (i = h.ending_track; i >= 0; i--) {
t.address_format = CD_LBA_FORMAT;
t.track = i;
! if (ioctlp(dev, CDIOREADTOCENTRY, (caddr_t)&t, FREAD, p) != 0)
return 0;
if ((t.entry.control & 4) != 0)
/* found a data track */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.981205163230.5450A-200000>
