|
Bugzilla – Full Text Bug Listing |
| Summary: | eject -T spawns ioctl: Input/output on Mac computers | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE 11.0 | Reporter: | Martin Szulecki <novell> |
| Component: | Basesystem | Assignee: | Anna Maresova <anicka> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Major | ||
| Priority: | P5 - None | CC: | chrubis |
| Version: | Factory | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | openSUSE 11.0 | ||
| Whiteboard: | |||
| Found By: | Beta-Customer | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: |
attempt to fix the bug using CDROM_DRIVE_STATUS
strace eject -T # no cd in drive strace eject -T # cd in drive strace eject # cd in drive, being ejected ok strace eject -T # unmounted cd, cd still in drive |
||
|
Description
Martin Szulecki
2008-03-27 18:19:00 UTC
I am afraid that while this patch fixes a problem for Apple users, it will break eject for anyone getting EIO because he was trying to eject a device that was plugged off before. It does not look really pretty. If I understand it right, apple cdroms cannot close on their own, so eject -T cannot work for them. Then the real fix should be making the eject button on Apple computers run "eject" instead of "eject -T", not breaking eject. Reassigning to Anna (new eject maintainer). Ah, the problem is that the heuristics itself used in ToggleTray. You cannot expect every drive to behave this way. There will be almost definitely drives which will behave differently. More appropriate way to do detect current tray status is to issue TEST_UNIT_READY and look at the sense data. If tray is open, it should say MEDIUM NOT PRESENT - TRAY OPEN. In which case, the tray should be closed. If the device is ready or the sense data is MEDIUM NOT PRESENT - TRAY CLOSED, the tray should be open. If the device is not ready but the sense data is none of the above two, you can't really tell the current tray status. In that case, falling back to the original heuristic should work. Created attachment 217587 [details]
attempt to fix the bug using CDROM_DRIVE_STATUS
Tejun, can you please take a look at this patch? Looking into the cdrom driver, I think that it does exactly what you propose in quite a neat way. Do you think it is correct?
Ah.. yeah, indeed. That's a nice ioctl to use and GET_EVENT_STATUS_NOTIFICATION used from the ioctl is definitely better way to detect this stuff. The only problem is that for ancient drives it will just report CDS_TRAY_OPEN but I don't really think that will be an issue at this point. Great. I have submitted package with this patch to the factory, I think it will fix it the issue. Please test my fix (either apply this patch or wait for a new package) and if there is something wrong, just reopen. Using eject-2.1.0-114, which apparently has that patch included, I still get the input/output error thus re-opening. Weird, because it have worked fine with my Mac. Can you please show me strace? Created attachment 219558 [details]
strace eject -T # no cd in drive
strace output attached for various situations.
I am testing on a Macbook1,1.
Created attachment 219559 [details]
strace eject -T # cd in drive
Created attachment 219560 [details]
strace eject # cd in drive, being ejected ok
Can you please show me one more strace? Please umount your CD and run strace on eject -T with CD in drive. I would like to see it because running eject -T with unmounted CD gives me EIO on any machine I have tried, not only on Apple laptop - it happens because umount is run only before eject, not before eject -T. I will fix it anyway, I just want to know whether it will help you. Created attachment 219665 [details]
strace eject -T # unmounted cd, cd still in drive
Yes, that works without any errors.
Great, thanks a lot. Actually I did not have the right idea of trying to eject mounted CD so I had to wait for your first strace to see what actually happens. Fix submitted, I hope that we can finally close now. (If not, you already know what to do :-)) |