Bug 137349
Summary: | eject doesnt work as user - returns error msg even when working | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Dams <anvil> | ||||||||
Component: | kernel | Assignee: | Dave Jones <davej> | ||||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | |||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | 3 | CC: | anvil, dnielsen, jonathansavage, pavel.polischouk, pfrields | ||||||||
Target Milestone: | --- | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | i386 | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2005-01-22 20:45:12 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Attachments: |
|
Description
Dams
2004-10-27 17:52:29 UTC
Created attachment 105853 [details]
strace eject scd0 > strace-anvil.txt 2>&1
strace as user.
Created attachment 105855 [details]
eject scd0 > ~anvil/strace-root.txt 2>&1
strace as root.
Out of curiosity, what happens if you modify eject to open the device read/write? Well, i can rip an audio cd, i can mount data cd, i can burn dvd, or just watch a video dvd. :p "normal" stuff. i don't have the usb2 DVDROM for testing. it looks like there's something broken or a limitation in scsi driver, which causes this problem. Does it eject with "eject /dev/cdrom" as user and root? could you please send the output of "eject -v /dev/cdrom" *sigh*. Today it seems to be working. -_-. [anvil@gruyere ~]# LC_ALL=en_US.UTF-8 eject -v /dev/cdrom eject: device name is `/dev/cdrom' eject: expanded name is `/dev/cdrom' eject: `/dev/cdrom' is a link to `/dev/scd0' eject: `/dev/scd0' is not mounted eject: `/dev/scd0' is not a mount point eject: `/dev/scd0' is not a multipartition device eject: trying to eject `/dev/scd0' using CD-ROM eject command eject: CD-ROM eject command succeeded 'eject scd0' works the same way. eject -t still doesnt work (both as user and root..) though. Not all devices support this command (CD-ROM tray close command). it seems your case here. I have tested some IDE CDROMs here, it works fine. Created attachment 105916 [details]
strace eject scd0 > ~anvil/strace-root.txt 2>&1 (this one for real)
The strace log as root wasnt exactly the good one. Re-attaching.
Sorry, re-opening. I can accept the closing tray stuff, but there's still something rotten with opening. Just rebooted with fresh new kernel. And it doesnt eject it anymore as user. Here is what you asked. [anvil@gruyere ~]# LC_ALL=en_US.UTF-8 eject -v eject: using default device `cdrom' eject: device name is `cdrom' eject: expanded name is `/dev/cdrom' eject: `/dev/cdrom' is a link to `/dev/scd0' eject: `/dev/scd0' is not mounted eject: `/dev/scd0' is not a mount point eject: `/dev/scd0' is not a multipartition device eject: trying to eject `/dev/scd0' using CD-ROM eject command eject: CD-ROM eject command failed eject: trying to eject `/dev/scd0' using SCSI commands eject: SCSI eject failed eject: trying to eject `/dev/scd0' using floppy eject command eject: floppy eject command failed eject: trying to eject `/dev/scd0' using tape offline command eject: tape offline command failed eject: unable to eject, last error: Invalid argument Running as root : [root@gruyere ~]# LC_ALL=en_US.UTF-8 eject -v /dev/cdrom eject: device name is `/dev/cdrom' eject: expanded name is `/dev/cdrom' eject: `/dev/cdrom' is a link to `/dev/scd0' eject: `/dev/scd0' is not mounted eject: `/dev/scd0' is not a mount point eject: `/dev/scd0' is not a multipartition device eject: trying to eject `/dev/scd0' using CD-ROM eject command eject: CD-ROM eject command failed eject: trying to eject `/dev/scd0' using SCSI commands eject: SCSI eject failed eject: trying to eject `/dev/scd0' using floppy eject command eject: floppy eject command failed eject: trying to eject `/dev/scd0' using tape offline command eject: tape offline command failed eject: unable to eject, last error: Invalid argument the scsi eject actually succeed and the tray is ejected. Not really consistent. Hum, look at this : [root@gruyere ~]# lsof /dev/cdrom COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME grip 5032 anvil 16r BLK 11,0 68888 /dev/scd0 if i kill grip before running 'eject', the tray is ejected when i run eject as user. I wouldnt blame grip.. I'm pretty sure anything opening the device will block the 'eject'. I'm seeing the same issue here, I have to manually eject cds as root after I ripped them in sound-juicer, it's a fairly annoying problem. good news, it appears that the latest HAL update fixes this, at least for me I appear to have spoken to soon, it worked the first time, after that I have no such luck. can you umount your cdrom device (umount /dev/cdrom)? if it works, does it ejects after you do "eject /dev/cdrom) afterwards? well audio cds doesn't mount, so umount doesn't do much to and the system does reply that it's not mounted according to mtab, eject complains with the usual invalid argument message that isn't of much help for the user. As user it just complains, as root it ejects then it complains. it seems a problem in scsi layer. it only works after a medium is inserted. please take a look at https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=134822 Here's a snippet of /var/log/messages when trying to execute eject: Nov 8 16:38:16 machine kernel: program eject is using a deprecated SCSI ioctl, please convert it to SG_IO Nov 8 16:38:27 machine last message repeated 4 times Seems like it's an eject bug, using deprecated system call. I'm getting this in Core 3 *release* as well w/ an internal dvd/cdrom. Could someone change the version to core 3 please? I'm seeing similar behaviour, tray ejects when I run as root, though I do get the error... Fedora Core 3, upgraded from 2 upgraded from 1. PIII 700, 1GB RAM, couple of SCSI disks, 1 standard ATAPI CD-ROM [root@morte ~]# uname -r 2.6.9-1.667 [root@morte ~]# grep CD /var/log/dmesg hdc: FX4820T, ATAPI CD/DVD-ROM drive hdc: ATAPI 48X CD-ROM drive, 128kB Cache, (U)DMA Uniform CD-ROM driver Revision: 3.20 This is the only ATAPI device (the disks are U160 SCSI) and I'm not using ide-scsi. [root@morte ~]# eject -v -t eject: using default device `cdrom' eject: device name is `cdrom' eject: expanded name is `/dev/cdrom' eject: `/dev/cdrom' is a link to `/dev/hdc' eject: `/dev/hdc' is not mounted eject: `/dev/hdc' is not a mount point eject: closing tray [root@morte ~]# eject -v eject: using default device `cdrom' eject: device name is `cdrom' eject: expanded name is `/dev/cdrom' eject: `/dev/cdrom' is a link to `/dev/hdc' eject: `/dev/hdc' is not mounted eject: `/dev/hdc' is not a mount point eject: `/dev/hdc' is a multipartition device eject: trying to eject `/dev/hdc' using CD-ROM eject command eject: CD-ROM eject command failed eject: trying to eject `/dev/hdc' using SCSI commands eject: SCSI eject failed eject: trying to eject `/dev/hdc' using floppy eject command eject: floppy eject command failed eject: trying to eject `/dev/hdc' using tape offline command eject: tape offline command failed eject: unable to eject, last error: Invalid argument [root@morte ~]# eject -v # ejecting again, even though the tray is already 'out' eject: using default device `cdrom' eject: device name is `cdrom' eject: expanded name is `/dev/cdrom' eject: `/dev/cdrom' is a link to `/dev/hdc' eject: `/dev/hdc' is not mounted eject: `/dev/hdc' is not a mount point eject: `/dev/hdc' is a multipartition device eject: trying to eject `/dev/hdc' using CD-ROM eject command eject: CD-ROM eject command succeeded I'm seeing the same complaint from /var/log/messages: Nov 22 09:34:17 morte kernel: program eject is using a deprecated SCSI ioctl, please convert it to SG_IO Nov 22 09:34:17 morte last message repeated 2 times It now appears to be working after a reboot. "eject" and "eject -t" work fine both with and without media, as root and normal user, and no errors nor kernel messages are generated. Ngo (comment 7) : by the way, as i thought, i've been (at last) able to test my dvdrom usb stuff on a good ol' 2.4 kernel and both opening and closing the tray work. Since this bug has been assigned to kernel, do you think that is related or should this be filled in another report ? I am having similar problems, but it seems to be related to the kind of cd that I put into my drive. For instance a regular, old cd with the proper audio disk logo on the back works as it should. However, I have two LOTR cd that are "enhanced cds," meaning that they are in fact NOT cds at all because they don't have the audio disk logo on the back (slight tangent). Anyway, these enhanced cds give me problems. After putting them in, the ONLY way I can get them to eject is as root user. Weird, huh? Also I cannot mount these cds even though they have files that can only be viewed by mounting them first. /dev/hdc: Input/output error mount: block device /dev/hdc is write-protected, mounting read-only /dev/hdc: Input/output error mount: /dev/hdc: can't read superblock It is all slightly annoying, but it's no show stopper. blah. Fixed since [at least] 0:2.6.9-1.724_FC3. Even eject -t is working now. No problem with latest FC3 2.6.10. |