Package: eject Version: 2.1.5+deb1+cvs20081104-13 Severity: important I should have reported this ages ago, sorry. :-(
I've got a system with several CD/DVD drives in it, and they all show the same behaviour. I think there's a kernel bug with CD locking at the root of the main problem here, and I'll report another bug there. For a while after I start my system, "eject /dev/srX" works just fine. However, after some non-determined period it stops working reliably. What I'm seeing is an annoying badly-reported error: sledge:/home/steve/iso# eject /dev/sr1 eject: unable to eject, last error: Inappropriate ioctl for device sledge:/home/steve/iso# eject /dev/sr1 eject: unable to eject, last error: Inappropriate ioctl for device sledge:/home/steve/iso# eject /dev/sr1 eject: unable to eject, last error: Inappropriate ioctl for device sledge:/home/steve/iso# eject /dev/sr1 After the fourth attempt here, the eject call works. I've tried hitting the eject button on the drive itself, but no joy. As to reporting ENOTTY, that's just *wrong*. Running the same under strace, I can see a silliness here that is the cause: open("/dev/sr1", O_RDONLY|O_NONBLOCK) = 3 ioctl(3, CDROMEJECT, 0) = -1 EIO (Input/output error) ioctl(3, SG_GET_VERSION_NUM, 0x7fff2e8f387c) = 0 ioctl(3, SG_IO, {'S', SG_DXFER_NONE, cmd[6]=[1e, 00, 00, 00, 00, 00], mx_sb_len=32, iovec_count=0, dxfer_len=0, timeout=10000, flags=0, status=00, masked_status=00, sb[0]=[], host_status=0, driver_status=0, resid=0, duration=0, info=0}) = 0 ioctl(3, SG_IO, {'S', SG_DXFER_NONE, cmd[6]=[1b, 00, 00, 00, 01, 00], mx_sb_len=32, iovec_count=0, dxfer_len=0, timeout=10000, flags=0, status=02, masked_status=01, sb[18]=[70, 00, 02, 00, 00, 00, 00, 0a, 3a, 00, bb, 00, 3a, 00, 00, 00, 00, 00], host_status=0, driver_status=0x8, resid=0, duration=4, info=0x1}) = 0 ioctl(3, FDEJECT, 0x7fff2e8f38b8) = -1 ENOTTY (Inappropriate ioctl for device) ioctl(3, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fff2e8f3890) = -1 ENOTTY (Inappropriate ioctl for device) For some daft reason, eject looks to be trying ioctl(CDROMEJECT), getting EIO as a failure mode, then falling back to ioctl(FDEJECT) on the CD drive. That last failure is the cause for the ENOTTY error, and that is reported incorrectly instead of the EIO that is the first (and correct) error. -- System Information: Debian Release: 7.5 APT prefers stable APT policy: (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores) Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages eject depends on: ii libc6 2.13-38+deb7u1 ii libdevmapper1.02.1 2:1.02.74-8 eject recommends no packages. Versions of packages eject suggests: ii cdtool 2.1.8-release-2 pn setcd <none> -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org