From: Christian Krause <chkr@plauener.de>
To: linux-hotplug@vger.kernel.org
Subject: cd-tray immediately closed after it has been opened
Date: Sun, 27 Jul 2008 19:19:52 +0000 [thread overview]
Message-ID: <488CCA58.7030409@plauener.de> (raw)
Hi,
A very annoying bug has been introduced in udev release 121:
In some distribution it is not possible to eject a CD or DVD anymore,
because the cd tray is immediately closed after it has been opened:
http://bugs.gentoo.org/show_bug.cgi?id#0886
https://bugzilla.redhat.com/show_bug.cgi?idE3095
We have tracked down the problem:
udev 120: works
udev > 121: problem occurs
The following checkin introduced the odd behaviour:
41677cf51fb2c14aa512ecf9410e43eb35560408
"persistent device naming: also read unpartitioned media"
with the following change in 60-persistent-storage.rules:
----------------------------------------------------------
+# import filesystem metadata
+IMPORT{program}="vol_id --export $tempnode"
----------------------------------------------------------
The following happens:
- the CD is ejected (by user)
- a change event is generated:
UDEV [1217184249.757495] change
/devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sr0 (block)
- the rule above triggers the execution of "vol_id --export ...sr0"
- vol_id opens the device with open(2), which causes the cd tray to be
closed
Before this checkin, vol_id was only called for partitioned devices and
so the CD tray stayed open.
I'm not an expert in writing udev rules, but I'm using now the following
workaround:
diff --git a/rules/rules.d/60-persistent-storage.rules
b/rules/rules.d/60-persistent-storage.rules
index 5ae0c7f..95eb1fd 100644
--- a/rules/rules.d/60-persistent-storage.rules
+++ b/rules/rules.d/60-persistent-storage.rules
@@ -52,6 +52,7 @@ ENV{DEVTYPE}="partition", ENV{ID_PATH}="?*",
SYMLINK+="disk/by-path/$env{ID_PA
# skip unpartitioned removable media devices from drivers which do not
send "change" events
ENV{DEVTYPE}="disk", KERNEL!="sd*|sr*", ATTR{removable}="1",
GOTO="persistent_storage_end"
+ENV{DEVTYPE}="disk", KERNEL="sr*", ATTR{removable}="1",
GOTO="persistent_storage_end"
# import filesystem metadata
IMPORT{program}="vol_id --export $tempnode"
If this patch is used, the vol_id call is omitted for sr* devices.
Sure, a drawback is, that you loose the "disk/by-label" link for CDs,
but IMHO these features are mainly targetted for USB hard drives or
something like this.
Best regards,
Christian Krause <chkr@plauener.de>
Ronald Wahl <rwahl@gmx.de>
next reply other threads:[~2008-07-27 19:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-27 19:19 Christian Krause [this message]
2008-07-27 23:35 ` cd-tray immediately closed after it has been opened David Zeuthen
2008-07-28 8:48 ` Christian Krause
2008-07-28 16:23 ` David Zeuthen
2008-07-30 17:27 ` Kay Sievers
2008-07-31 7:31 ` Christian Krause
2008-07-31 7:48 ` Kay Sievers
2008-08-01 19:23 ` David Zeuthen
2008-08-03 17:38 ` Christian Krause
2008-08-04 6:52 ` Kay Sievers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=488CCA58.7030409@plauener.de \
--to=chkr@plauener.de \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.