[Bug 909418] New: when ejecting DVD using hardware button, system thinks DVD is still mounted
http://bugzilla.opensuse.org/show_bug.cgi?id=909418 Bug ID: 909418 Summary: when ejecting DVD using hardware button, system thinks DVD is still mounted Classification: openSUSE Product: openSUSE Distribution Version: 13.2 Hardware: x86-64 OS: openSUSE 13.2 Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: bnc-team-screening@forge.provo.novell.com Reporter: Ulrich.Windl@rz.uni-regensburg.de QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- When I used a mounted DVD (in a BluRay writer) and press eject-button on the drive, the media ejects, and I close the tray. In GNOME (at least) the system still thinks the media is mounted, even if I inserted another DVD into the drive in the meantime. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Bernhard Wiedemann
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #2 from Ulrich Windl
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #3 from Ulrich Windl
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Bernhard Wiedemann
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Ulrich Windl
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Robert Milasan
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #8 from Takashi Iwai
Takashi, this cant be udev issue,
It is. We confirmed that just changing udev rules fixes the problem.
the implemention of lock-media and eject-media has been in udev since 2011:
commit b20fd3cb3423676a86f12189126b012d2297d5f7 Author: Kay Sievers
Date: Sat Jun 18 20:54:47 2011 +0200 cdrom_id: add tray lock and eject handling
Or at least is not exactly the issue with locking and ejecting.
So it has been "broken" since then :) It's no new regression after all. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Robert Milasan
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Robert Milasan
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #11 from Robert Milasan
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #12 from Oliver Neukum
OK, this is about 90% a kernel issue. I've done some more test and looks like there are no change events when the hardware button (eject) is pressed.
So when we eject the cd media and we put a new disk in it, it suppose to have 2 events, one for the eject itself and one for the media change, we only have the second one. This actually works in 13.1, but not in 13.2.
Please recheck Takashi.
linux-0dmf:/usr/lib/udev/rules.d # udevadm monitor -k -p monitor will print the received events for: KERNEL - the kernel uevent KERNEL[83652.573173] change /devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sr0 (block) ACTION=change DEVNAME=/dev/sr0 DEVPATH=/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sr0 DEVTYPE=disk DISK_MEDIA_CHANGE=1 MAJOR=11 MINOR=0 SEQNUM=2864 SUBSYSTEM=block KERNEL[83667.933326] change /devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sr0 (block) ACTION=change DEVNAME=/dev/sr0 DEVPATH=/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sr0 DEVTYPE=disk DISK_EJECT_REQUEST=1 MAJOR=11 MINOR=0 SEQNUM=2865 SUBSYSTEM=block KERNEL[83672.484749] change /devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sr0 (block) ACTION=change DEVNAME=/dev/sr0 DEVPATH=/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sr0 DEVTYPE=disk DISK_MEDIA_CHANGE=1 MAJOR=11 MINOR=0 SEQNUM=2866 SUBSYSTEM=block -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Oliver Neukum
OK, this is about 90% a kernel issue. I've done some more test and looks like there are no change events when the hardware button (eject) is pressed.
I suggest you forget about VirtualBox. Get real hardware. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #14 from Robert Milasan
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #15 from Oliver Neukum
So it actually work as it suppose to. I cant reporduce this in 13.1 nor 13.2 using Gnome and/or Cinnamon.
I just retested 13.1 and 13.2 you can eject a mounted DVD. Both distros show both events. To me this udev rule looks like unnecessary stuff that really only makes matters worse. Leaving this to the kernel works without a problem. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #16 from Takashi Iwai
So it actually work as it suppose to.
No, udev rule is doing wrong. It should have some sanity check or doing umount at least like eject command does.
I cant reporduce this in 13.1 nor 13.2 using Gnome and/or Cinnamon.
Better to avoid GNOME. It might be that GNOME does something special. Just go to Linux console, and mount manually, and press eject event. And watch out udevadm monitor whether you get EJECT event, as Oliver put in comment 12. If no EJECT is seen, your hardware is an exception. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #17 from Robert Milasan
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #18 from Takashi Iwai
OK, will do, thanks.
I guess, the fix can be done on Monday too. BTW, we will need cdrom binary to run at least once in the rule. So, I'll check to see how it would be the best idea.
Thanks. Easy workarounds that came to my mind are: 1. remove --lock-media option and eject entry. 2. replace "cdrom_id --eject" call with "/usr/bin/eject". 3. hack cdrom_id to check mount before performing eject. 1 is to revert to the old state. It's confirmed to work, but we need to know why the explicit lock and eject calls were added in the past above all. 2 is easy, does umount, but this of course doesn't block the eject like before. Maybe this is no go. For 3, I quickly tested the onliner patch below. However, this seems confusing KDE, at least. When the eject button is pressed, KDE removes the DVD icon on Dolphin window even if it's still there (thus you can't unmount from GUI any longer). Maybe someone is listening to the eject event as well? It's puzzling why this problem isn't seen with the option 1, though... --- a/src/udev/cdrom_id/cdrom_id.c +++ b/src/udev/cdrom_id/cdrom_id.c @@ -983,7 +983,7 @@ work: media_lock(udev, fd, false); } - if (eject) { + if (eject && !is_mounted(node)) { log_debug("PREVENT_ALLOW_MEDIUM_REMOVAL (unlock)"); media_lock(udev, fd, false); log_debug("START_STOP_UNIT (eject)"); -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #19 from Ulrich Windl
udevadm monitor -k -p
My kernel is 3.16.7-7-desktop (x86_64). I started the command above when the DVD was mounted. Then I pressed eject botton on the drive, and the tray opened after a moment. After that mount still shows /dev/sr0 on /run/media/windl/openSUSE-13.2-DVD-x86_640051 type iso9660 ... It seems udev just receives two events: DISK_EJECT_REQUEST=1 DISK_MEDIA_CHANGE=1 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #20 from Ulrich Windl
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Ulrich Windl
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #21 from Takashi Iwai
(In reply to Robert Milasan from comment #9)
udevadm monitor -k -p
My kernel is 3.16.7-7-desktop (x86_64). I started the command above when the DVD was mounted. Then I pressed eject botton on the drive, and the tray opened after a moment. After that mount still shows /dev/sr0 on /run/media/windl/openSUSE-13.2-DVD-x86_640051 type iso9660 ...
It seems udev just receives two events: DISK_EJECT_REQUEST=1 DISK_MEDIA_CHANGE=1
Could you check that modifying udev rules fixes the issue as in comment 6? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Robert Milasan
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #23 from Robert Milasan
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #25 from Oliver Neukum
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #26 from Robert Milasan
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #27 from Takashi Iwai
I tested both, they don't work.
Here is the scenario:
1. insert CD/DVD in the drive 2. mount the drive: mount /dev/sr0 /mnt (just an example) 3. eject CD/DVD from the drive
Who eject the media? Does the hardware do it by itself, or does the system issue any SCSI command (apparently but for udev)? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #28 from Robert Milasan
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Oliver Neukum
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
--- Comment #29 from Takashi Iwai
If I remove the "--lock-media" option I get a strange result. The button works again on unmounted media. But there's no event. With a mounted medium the button doesn't eject the CD, yet an event is generated. It seems like this interface is flawed, if you want consistent notification about events for a GUI.
I confirmed this behavior, too. And it actually leaves the DVD icon even after the media is ejected. So this is no perfect solution, either. Hmm. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Ulrich Windl
Could you check that modifying udev rules fixes the issue as in comment 6?
I found that my system has no rule starting with "60-cdrom_id.rules"; I only see these rules: 55-libsane.rules 56-sane-backends-autoconfig.rules 70-persistent-net.rules Ah, I see: There are more rules in /usr/lib/udev/rules.d! So I just commented the first line (--eject-media), and my tray won't open, even if the DVD is not mounted! When also commenting the second line (--lock-media) (and ejecting/reloading the media using the "eject" command, the tray would open when the media was not mounted, but the tray would also open when the media was mounted (kernel: VFS: busy inodes on changed media or resized disk sr0)! I re-tried after "udevadm control -R": When not mounted, the tray will open, and the tray will also open when the media was mounted. As I said in comment 0: "I suspect this might be a kernel problem." -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Takashi Iwai
(In reply to Takashi Iwai from comment #21)
Could you check that modifying udev rules fixes the issue as in comment 6?
I found that my system has no rule starting with "60-cdrom_id.rules"; I only see these rules: 55-libsane.rules 56-sane-backends-autoconfig.rules 70-persistent-net.rules Ah, I see: There are more rules in /usr/lib/udev/rules.d! So I just commented the first line (--eject-media), and my tray won't open, even if the DVD is not mounted! When also commenting the second line (--lock-media) (and ejecting/reloading the media using the "eject" command, the tray would open when the media was not mounted, but the tray would also open when the media was mounted (kernel: VFS: busy inodes on changed media or resized disk sr0)!
eject command may do this.
I re-tried after "udevadm control -R": When not mounted, the tray will open, and the tray will also open when the media was mounted. As I said in comment 0: "I suspect this might be a kernel problem."
Please read through the whole bugzilla comments (this and bug 912715). I still didn't get the test result of comment 30. Please test the kernel package there *without* modification of udev rules. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
Adam Williams
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
http://bugzilla.opensuse.org/show_bug.cgi?id=909418#c41
Franck Bui
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
http://bugzilla.opensuse.org/show_bug.cgi?id=909418#c54
Ulrich Windl
Didn't you see this behavior earlier?
I just found bug 696851 (openSUSE 11.4). (In reply to Franck Bui from comment #41)
Closing as it should be fixed by the next update.
Problem still present on openSUSE Leap 42.3 (kernel 4.4.143-65-default)! My "CD-ROM" drive is actually a BluRay Writer (in case it matters): Model: "HL-DT-ST BD-RE BH10LS30" Vendor: "HL-DT-ST" Device: "BD-RE BH10LS30" Revision: "1.01" Driver: "ahci", "sr" Driver Modules: "ahci", "sr_mod" -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
http://bugzilla.opensuse.org/show_bug.cgi?id=909418#c55
--- Comment #55 from Ulrich Windl
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
http://bugzilla.opensuse.org/show_bug.cgi?id=909418#c56
Oliver Neukum
Maybe if the kernel allows ejecting a device that is open (mounted), a callback should "umount" (close) the device.
Yes. Hence Takashi's suggestion in comment #6
Still I think that ejecting a mounted medium should not be possible in the non-emergency case. GUIs could pop up a message box saying that the request to unmount/eject the device was denied as there a files being used still. Why should an optical medium be so much different from some disk medium?
1. It is read only 2. That is what other OSes do (let's be honest) 3. We generally presume the user knows what his doing 4. If the drive is external, the user can just unplug it -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=909418
http://bugzilla.opensuse.org/show_bug.cgi?id=909418#c57
--- Comment #57 from Franck Bui
Problem still present on openSUSE Leap 42.3 (kernel 4.4.143-65-default)! My "CD-ROM" drive is actually a BluRay Writer (in case it matters):
what does "udevadm info /dev/xxx" show for this device ? -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com