| Summary: | CD tray is not locked even if using /dev/adc0. | ||
|---|---|---|---|
| Product: | Base System | Reporter: | KOIE Hidetaka <koie> |
| Component: | misc | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 9.0-CURRENT | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
KOIE Hidetaka
2011-03-25 02:10:10 UTC
this issue is not limited to acd. using cdcontrol -f /dev/cd gives the same behavior. plus camcontrol eject cd0 also ejects a mounted cd. cheers. alex -- a13x On 2011-03-25, Alexander Best wrote: > this issue is not limited to acd. using cdcontrol -f /dev/cd gives the same > behavior. I think this is because cdcontrol(1) first issues the CDIOCALLOW ioctl to unlock the tray. Does this patch fix your problem? http://www.saunalahti.fi/~jh3/patches/cdcontrol-no-CDIOCALLOW.diff I am inclined to think that the behavior is intentional. -- Jaakko On Sat Mar 26 11, Jaakko Heinonen wrote: > On 2011-03-25, Alexander Best wrote: > > this issue is not limited to acd. using cdcontrol -f /dev/cd gives the same > > behavior. > > I think this is because cdcontrol(1) first issues the CDIOCALLOW ioctl > to unlock the tray. Does this patch fix your problem? > > http://www.saunalahti.fi/~jh3/patches/cdcontrol-no-CDIOCALLOW.diff > > I am inclined to think that the behavior is intentional. i think the actual issue is not cdcontrol(1) so much, as CDIOCALLOW itself. looking at this PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=125139 shouldn't CDIOCALLOW and CDIOCPREVENT have the same busy checks like CDIOCEJECT (as pointed out in the PR)? i haven't tested your patch, but i think it works. CDIOCEJECT checks the ref count. without the CDIOCALLOW and a ref count >= 1 the cd won't be ejected. i'm not sure whether CDIOCALLOW and CDIOCPREVENT should stay the way they are or not. making them dependent on the ref count won't allow ejecting a CD at all. this might cause problems if or some reason the ref count cannot be set to 0. e. g. unmounting a broken CD/DVD might fail. i'm not sure if umount -f will always suceeded, so we might not be able to reduce the ref count to 0 in certain situations. if in fact CDIOCALLOW/CDIOCPREVENT should work regardless of the ref count i think your patch is good to go. here are the other places CDIOCALLOW is being used: otaku% grep -r CDIOCALLOW * share/man/man4/cd.4:.It Dv CDIOCALLOW sys/cam/scsi/scsi_cd.c: case CDIOCALLOW: sys/dev/ata/atapi-cd.c: case CDIOCALLOW: sys/dev/mcd/mcd.c: case CDIOCALLOW: sys/dev/scd/scd.c: case CDIOCALLOW: sys/sys/cdio.h:#define CDIOCALLOW _IO('c',26) usr.sbin/cdcontrol/cdcontrol.c: (void) ioctl (fd, CDIOCALLOW); usr.sbin/cdcontrol/cdcontrol.c: (void) ioctl (fd, CDIOCALLOW); usr.sbin/cdcontrol/cdcontrol.c: (void) ioctl (fd, CDIOCALLOW); usr.sbin/sysinstall/cdrom.c: ioctl(fd, CDIOCALLOW); cheers. alex > > -- > Jaakko -- a13x Message-Id: <20110326171054.GA1528@a91-153-123-205.elisa-laajakaista.. Date: Sat, 26 Mar 2011 19:10:55 +0200 From: Jaakko Heinonen <jh@FreeBSD.org> Subject: Re: misc/155925: CD tray is not locked even if using /de.. | On 2011-03-25, Alexander Best wrote: | > this issue is not limited to acd. using cdcontrol -f /dev/cd gives the same | > behavior. | | I think this is because cdcontrol(1) first issues the CDIOCALLOW ioctl | to unlock the tray. Does this patch fix your problem? | | http://www.saunalahti.fi/~jh3/patches/cdcontrol-no-CDIOCALLOW.diff | | I am inclined to think that the behavior is intentional. | | -- | Jaakko I apply this patch and try: % /usr/obj/usr/src/usr.sbin/cdcontrol/cdcontrol eject cdcontrol: Input/output error ok, buk pushing the eject button still ejects a tray... -- KOIE Hidetaka / koie@suri.co.jp / SURIGIKEN Co.,LTD. On 2011-03-28, KOIE Hidetaka wrote:
> I apply this patch and try:
> % /usr/obj/usr/src/usr.sbin/cdcontrol/cdcontrol eject
> cdcontrol: Input/output error
>
> ok, buk pushing the eject button still ejects a tray...
Thanks for testing. Could you try if the latest patch in PR kern/125139
helps?
--
Jaakko
Message-Id: <20110328152329.GA1526@a91-153-123-205.elisa-laajakaista.. Date: Mon, 28 Mar 2011 18:23:30 +0300 From: Jaakko Heinonen <jh@FreeBSD.org> Subject: Re: misc/155925: CD tray is not locked even if using /de.. | On 2011-03-28, KOIE Hidetaka wrote: | > I apply this patch and try: | > % /usr/obj/usr/src/usr.sbin/cdcontrol/cdcontrol eject | > cdcontrol: Input/output error | > | > ok, buk pushing the eject button still ejects a tray... | | Thanks for testing. Could you try if the latest patch in PR kern/125139 | helps? | | -- | Jaakko I try "patch-2.diff". note: a hunk for acd_modevent() is already applied in the current source. case1 (using patched cdcontrol): # mount_cd9660 /dev/acd0 /mnt # push the eject button -> no action # /usr/obj/usr/src/usr.sbin/cdcontrol/cdcontrol eject cdcontrol: Input/output error # /usr/obj/usr/src/usr.sbin/cdcontrol/cdcontrol eject cdcontrol: Input/output error # push the eject button -> ejected case 2 (using plain cdcontrol): # mount_cd9660 /dev/acd0 /mnt # /usr/sbin/cdcontrol eject -> ejected -- KOIE Hidetaka / koie@suri.co.jp / SURIGIKEN Co.,LTD. State Changed From-To: open->closed This problem report appears to describe the very same issue that are being discussed in kern/125139. |