NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/51331: cdrom will not mount after first time
The following reply was made to PR bin/51331; it has been noted by GNATS.
From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: bin/51331: cdrom will not mount after first time
Date: Tue, 12 Jul 2016 07:32:58 +0700
Date: Mon, 11 Jul 2016 20:45:00 +0000 (UTC)
From: scole_mail%gmx.com@localhost
Message-ID: <20160711204501.02BE17AAB6%mollari.NetBSD.org@localhost>
| I messed around with this a little bit today and am more inclined to
| think software bug and not bad hardware.
From what I have read of your reports, I agree - it never really looked like
a hardware problem to me.
My guess from what you have described is that what is happening, is that
upon eject, the in-core label is set so that all partitions are FS_UNUSED
and when you attempt to open a FS_UNUSED partition, the driver returns
ENXIO (Device not configured) - which fits the symptoms exactly.
That check doesn't happen when the raw partition is opened, so accessing via
/dev/[r]cd0d would still work, which is probably why the other programs
(that access the CD via lower level mechanisms) still function fine.
You could test this hypothesis by getting to the point where /dev/cd0a mounts
are failing, and then try
mount -t cd9660 -r /dev/cd0d /cdrom
and see if that works.
What is supposed to happen is that when the CD is first opened, if the
media is not marked "loaded" ...
if ((periph->periph_flags & PERIPH_MEDIA_LOADED) == 0) {
the label is read (of there is one, which is unusual on a CD) or a
default label is constructed (the more normal case, with cd0a set to
FS_ISO9660 instead of FS_UNUSED).
What I don't see in sys/dev/scsipi/cd.c is any code to clear PERIPH_MEDIA_LOADED
after an eject is done. Yet the p_fstype of all entries in the label is
set to FS_UNUSED - so it seems likely than on any open after an eject,
on anything other than the raw partition is guaranteed to fail.
| So I could mount/unmount the cdrom any number of times, but only if
| didn't eject. Once ejected, I could not mount any longer and had to
| reboot.
You could also test this more by ejecting using the button on the drive,
rather than the command - if you can still mount the cd after ejecting
and reloading that way, I suspect we will have understood the problem,
and only need a suitable patch to clear PERIPH_MEDIA_LOADED at appropriate
places.
kre
Home |
Main Index |
Thread Index |
Old Index