Bug 496683 - udev fails to detect filesystem on fake cdrom drive
Summary: udev fails to detect filesystem on fake cdrom drive
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: udev
Version: 11
Hardware: All
OS: Linux
low
urgent
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-04-20 17:40 UTC by Daniel Qarras
Modified: 2010-01-11 15:56 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-10-23 18:05:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
proc-self-mountinfo.txt (797 bytes, text/plain)
2009-04-20 19:52 UTC, Daniel Qarras
no flags Details
devkit-disks--dump.txt (17.10 KB, text/plain)
2009-04-20 19:53 UTC, Daniel Qarras
no flags Details
devkit-disks--monitor-detail.txt (3.52 KB, text/plain)
2009-04-20 19:53 UTC, Daniel Qarras
no flags Details
gvfs-mount-li.txt (1.25 KB, text/plain)
2009-04-20 19:53 UTC, Daniel Qarras
no flags Details
gvfs-mount-oi.txt (905 bytes, text/plain)
2009-04-20 19:54 UTC, Daniel Qarras
no flags Details
dmesg-related.txt (708 bytes, text/plain)
2009-04-20 20:25 UTC, Daniel Qarras
no flags Details
udevadm-monitor--env.txt (10.93 KB, text/plain)
2009-04-20 20:25 UTC, Daniel Qarras
no flags Details
switch to ID_CDROM_MEDIA to decide if vol_id should run (1.92 KB, patch)
2009-04-20 21:59 UTC, Kay Sievers
no flags Details | Diff
udevadm-test-class-block-sr1.txt (11.39 KB, text/plain)
2009-05-25 21:17 UTC, Daniel Qarras
no flags Details

Description Daniel Qarras 2009-04-20 17:40:38 UTC
Description of problem:
After upgrading to DeviceKit-disks-004-0.10.20090415git.fc11.i586 some Nokia mobile phones (like Nokia E75) partitions are not visible when connected with USB.

I noted this issue on one system and suspected a kernel bug (see Bug 495446) but I tested on another system upgrading and rebooting packages individually and it was actually DeviceKit-disks-004-0.10.20090415git.fc11.i586 which triggered this error.

Version-Release number of selected component (if applicable):
DeviceKit-disks-004-0.10.20090415git.fc11.i586

How reproducible:
Always.

Steps to Reproduce:
1. Connect Nokia E75 with USB to a computer in "PC Internet Access mode"
2. Notice how only "Blank CD-ROM" shows up, no partitions at all

  
Actual results:
No partitions.

Expected results:
Partitions visible.

Additional info:
Reporting against hal because I can't find DeviceKit component from Bugzilla.

Comment 1 Daniel Qarras 2009-04-20 17:45:01 UTC
Hmm, only now I see

https://bugzilla.redhat.com/show_bug.cgi?id=495876

Not sure which is there still some pending upgrades, probably need to wait for a day or two to be sure.

Comment 2 Daniel Qarras 2009-04-20 17:48:43 UTC
Fixing component (not my day).

Comment 3 David Zeuthen 2009-04-20 19:18:08 UTC
Please include the information mentioned here

 http://www.freedesktop.org/wiki/Software/DeviceKit-disks

Comment 4 Daniel Qarras 2009-04-20 19:52:27 UTC
Thanks for looking into this. I will attach 5 attachment generated based on the instructions.

Comment 5 Daniel Qarras 2009-04-20 19:52:59 UTC
Created attachment 340418 [details]
proc-self-mountinfo.txt

Comment 6 Daniel Qarras 2009-04-20 19:53:17 UTC
Created attachment 340419 [details]
devkit-disks--dump.txt

Comment 7 Daniel Qarras 2009-04-20 19:53:35 UTC
Created attachment 340420 [details]
devkit-disks--monitor-detail.txt

Comment 8 Daniel Qarras 2009-04-20 19:53:51 UTC
Created attachment 340421 [details]
gvfs-mount-li.txt

Comment 9 Daniel Qarras 2009-04-20 19:54:09 UTC
Created attachment 340422 [details]
gvfs-mount-oi.txt

Comment 10 David Zeuthen 2009-04-20 20:10:40 UTC
Hmm, looks like the kernel is not creating the devices - all we get from the phone is /dev/sr1. What were you expecting, a USB storage device (e.g. /dev/sdb)? Or content on /dev/sr1?

Please capture the relevant bits from dmesg when plugging the device and attach it here. Also please include the output of 'udevadm monitor --env' run as root (also when plugging in the device).

Comment 11 Daniel Qarras 2009-04-20 20:25:01 UTC
The phone can be connected in five different modes with USB - the current mode I'm using shows up as a CD-ROM in Windows XP and also in Fedora few days ago with files on a partition on it.

I will attach the requested files. Thanks!

Comment 12 Daniel Qarras 2009-04-20 20:25:32 UTC
Created attachment 340430 [details]
dmesg-related.txt

Comment 13 Daniel Qarras 2009-04-20 20:25:52 UTC
Created attachment 340431 [details]
udevadm-monitor--env.txt

Comment 14 David Zeuthen 2009-04-20 20:57:55 UTC
CD-ROM discs can't have partitions in Linux... did you mean that a file system used to be detected on /dev/sr1?

Anyway, try running '/lib/udev/vol_id --export /dev/sr1' and paste the output here. If that's empty try with --probe-all (and please state whether you had to do that).

Comment 15 Daniel Qarras 2009-04-20 21:06:02 UTC
Yes, I meant /dev/sr1. I even created a bug report about another issue when things were working (just to prove that I was not hallucinating):

http://bugzilla.gnome.org/show_bug.cgi?id=579436

Anyway, here's the output:

root@localhost:~# /lib/udev/vol_id --export /dev/sr1
ID_FS_USAGE=filesystem
ID_FS_TYPE=iso9660
ID_FS_VERSION=
ID_FS_UUID=
ID_FS_UUID_ENC=
ID_FS_LABEL=CDROM
ID_FS_LABEL_ENC=CDROM
root@localhost:~# /lib/udev/vol_id --export /dev/sr1 --probe-all
iso9660

Comment 16 David Zeuthen 2009-04-20 21:23:46 UTC
According to comment 13, ID_CDROM_MEDIA_TRACK_COUNT is not set.

That's why udev doesn't run vol_id on the device since these are the rules we use

 # probe filesystem metadata of optical drives which have a media inserted
 KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT}=="?*", IMPORT{program}="vol_id --export --skip-raid --offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"

 # probe filesystem metadata of disks
 KERNEL!="sr*", IMPORT{program}="vol_id --export $tempnode"

My guess is that we either need to relax these udev rules or fix cdrom_id. Reassigning to udev and adding the upstream udev maintainer to the Cc. Kay, any ideas here?

FWIW, this also happens with my Sandisk Cruzer USB stick, this device "conveniently" exports a CD-ROM drive with Windows drivers in addition to the storage device itself.

Comment 17 David Zeuthen 2009-04-20 21:24:26 UTC
Fixing up summary.

Comment 18 David Zeuthen 2009-04-20 21:30:42 UTC
Also, somewhat interesting is that cdrom_id sets

 ID_CDROM_MEDIA_STATE=blank

Now, IIRC, this is probably just because the device is dumb... 

But we should probably guard against dumb devices like this if the size of the device much larger than 0. And according to comment 6, devkit-disks-daemon reports the size as 8626176 bytes - IIRC, this is obtained from sysfs.

Comment 19 Kay Sievers 2009-04-20 21:59:32 UTC
Created attachment 340443 [details]
switch to ID_CDROM_MEDIA to decide if vol_id should run

Care to try this? Thanks!

Comment 20 Daniel Qarras 2009-04-22 19:20:18 UTC
Err, udev rules on F11 seem to be completely different than what is in your patch. I could sure test but could some please lend me a hand a produce a patch for udev of F11 fame? Thanks!

Comment 21 Daniel Qarras 2009-04-26 09:10:16 UTC
I now tried udev-141-3.fc11.i586 from updates-testing which seems to include the patch. The behaviour has changed but the issue still remains: the CD-ROM is still showing up as a blank CD but now I get a pop-up window which ask what to do with it. Previously there was no pop-up window, only the blank CD-ROM icon appeared to the desktop.

Below is dmesg output when plugging the phone with udev-141-3.fc11.i586:

Apr 26 12:07:39 localhost kernel: usb 1-8: new high speed USB device using ehci_hcd and address 3
Apr 26 12:07:39 localhost kernel: usb 1-8: New USB device found, idVendor=0421, idProduct=010d
Apr 26 12:07:39 localhost kernel: usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 26 12:07:39 localhost kernel: usb 1-8: Product: Nokia E75
Apr 26 12:07:39 localhost kernel: usb 1-8: Manufacturer: Nokia
Apr 26 12:07:39 localhost kernel: usb 1-8: SerialNumber: 1234567890
Apr 26 12:07:39 localhost kernel: usb 1-8: configuration #1 chosen from 1 choice
Apr 26 12:07:39 localhost kernel: Initializing USB Mass Storage driver...
Apr 26 12:07:39 localhost kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Apr 26 12:07:39 localhost kernel: usbcore: registered new interface driver usb-storage
Apr 26 12:07:39 localhost kernel: USB Mass Storage support registered.
Apr 26 12:07:44 localhost kernel: scsi 2:0:0:0: CD-ROM            Nokia    S60              1.0  PQ: 0 ANSI: 2
Apr 26 12:07:44 localhost kernel: sr1: scsi3-mmc drive: 0x/0x xa/form2 tray
Apr 26 12:07:44 localhost kernel: sr 2:0:0:0: Attached scsi generic sg2 type 5

Comment 22 Daniel Qarras 2009-04-26 10:03:02 UTC
Hmm, now I realized that also libudev0 / libvolume_id want to be updated. But after updating also these packages things went worse: now I can't see the CD-ROM device at all, dmesg says:

Apr 26 13:01:10 localhost kernel: usb 1-8: new high speed USB device using ehci_hcd and address 4
Apr 26 13:01:10 localhost kernel: usb 1-8: New USB device found, idVendor=0421, idProduct=010d
Apr 26 13:01:10 localhost kernel: usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 26 13:01:10 localhost kernel: usb 1-8: Product: Nokia E75
Apr 26 13:01:10 localhost kernel: usb 1-8: Manufacturer: Nokia
Apr 26 13:01:10 localhost kernel: usb 1-8: SerialNumber: 1234567890
Apr 26 13:01:10 localhost kernel: usb 1-8: configuration #1 chosen from 1 choice
Apr 26 13:01:11 localhost kernel: scsi3 : SCSI emulation for USB Mass Storage devices
Apr 26 13:01:16 localhost kernel: scsi 3:0:0:0: CD-ROM            Nokia    S60              1.0  PQ: 0 ANSI: 2

Comment 23 Daniel Qarras 2009-05-24 09:36:37 UTC
udev-141-3.fc11.i586
kernel-2.6.29.3-155.fc11.i586

give me now a blank CD-ROM again and in dmesg:

usb 1-8: new high speed USB device using ehci_hcd and address 4
usb 1-8: New USB device found, idVendor=0421, idProduct=010d
usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-8: Product: Nokia E75
usb 1-8: Manufacturer: Nokia
usb 1-8: SerialNumber: 1234567890
usb 1-8: configuration #1 chosen from 1 choice
Initializing USB Mass Storage driver...
scsi2 : SCSI emulation for USB Mass Storage devices
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usb-storage: device found at 4
usb-storage: waiting for device to settle before scanning
usb-storage: device scan complete
scsi 2:0:0:0: CD-ROM            Nokia    S60              1.0  PQ: 0 ANSI: 2
sr1: scsi3-mmc drive: 0x/0x xa/form2 tray
sr 2:0:0:0: Attached scsi CD-ROM sr1
sr 2:0:0:0: Attached scsi generic sg2 type 5

Comment 24 Kay Sievers 2009-05-24 13:08:01 UTC
What does:
  /lib/udev/cdrom_id -d /dev/sr1
print?

Comment 25 Daniel Qarras 2009-05-24 14:04:50 UTC
root@localhost:~# /lib/udev/cdrom_id -d /dev/sr1
main: probing: '/dev/sr1'
cd_inquiry: INQUIRY: [Nokia   ][S60             ][1.0 ]
cd_profiles: GET CONFIGURATION: number of profiles 76
cd_profiles: current profile 0x08
cd_media_toc: READ TOC: len: 12
cd_media_toc: last track 1 starts at block 0
cd_media_info: disk type 00
ID_CDROM=1
ID_CDROM_MRW=1
ID_CDROM_MRW_W=1
ID_CDROM_MEDIA=1
ID_CDROM_MEDIA_CD=1
ID_CDROM_MEDIA_STATE=blank
root@localhost:~#

Comment 26 Kay Sievers 2009-05-24 16:11:36 UTC
That looks good so far.

Maybe the port of the bugfix in udev 141 did not contain the rule change, which was part of the fix in udev 142?

The upstream fix is here:
  http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=f907449eee3f58fafafee0658e80578b1dbb2722

Do you see this change in the rules file on your system?

Comment 27 Daniel Qarras 2009-05-24 18:48:57 UTC
It seems that Fedora has totally different rules in use since I see neither the old or the new rule at all:

root@localhost:~# grep -ri cdrom_media /etc/udev 
zsh: exit 1     grep --color=tty -ri cdrom_media /etc/udev
root@localhost:~# 

So it seems the Fedora udev maintainer is needed here to help.

Thanks!

Comment 28 Kay Sievers 2009-05-25 00:21:49 UTC
Oh, that should be fine. The default rules are in /lib/udev/.

Comment 29 Harald Hoyer 2009-05-25 07:39:21 UTC
the fix from comment #26 is in the latest udev of Fedora 11

$ grep -ri cdrom_media /lib/udev/
/lib/udev/rules.d/60-persistent-storage.rules:KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="vol_id --export --skip-raid --offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"

Comment 30 Harald Hoyer 2009-05-25 07:39:45 UTC
$ rpm -q udev
udev-141-3.fc11.x86_64

Comment 31 Kay Sievers 2009-05-25 11:15:23 UTC
Ok, if that's in, what does:
  udevadm test /class/block/sr1
print?

Comment 32 Daniel Qarras 2009-05-25 21:16:52 UTC
A-ha, it seems that we're back to where we started:

> Description of problem:
> After upgrading to DeviceKit-disks-004-0.10.20090415git.fc11.i586 some Nokia
> mobile phones (like Nokia E75) partitions are not visible when connected with
> USB.

This is because Harald got:

$ grep -ri cdrom_media /lib/udev/
/lib/udev/rules.d/60-persistent-storage.rules:KERNEL=="sr*",
ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="vol_id --export --skip-raid
--offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"

But I see:

root@localhost:~# rpm -q udev
udev-141-3.fc11.i586
root@localhost:~# grep -ri cdrom_media /lib/udev/
/lib/udev/rules.d/95-devkit-disks.rules:KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT}!="?*", GOTO="probe_parttable_end"
/lib/udev/rules.d/60-persistent-storage.rules:KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="vol_id --export --skip-raid --offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
Binary file /lib/udev/cdrom_id matches
root@localhost:~# rpm -qf /lib/udev/rules.d/95-devkit-disks.rules
DeviceKit-disks-004-3.fc11.i586
root@localhost:~# rpm -V udev DeviceKit-disks
root@localhost:~# 

Well, if my guess is wrong, I'll attach the output requested.

Thanks!

Comment 33 Daniel Qarras 2009-05-25 21:17:25 UTC
Created attachment 345358 [details]
udevadm-test-class-block-sr1.txt

Comment 34 Kay Sievers 2009-05-25 21:43:03 UTC
The udev side seems fine, it reports a filesystem:
  'ID_FS_USAGE=filesystem'
  'ID_FS_TYPE=iso9660'

Comment 35 Daniel Qarras 2009-05-25 21:53:45 UTC
Hmm, I commented out the rule in 95-devkit-disks.rules and rebooted, but I still get a blank CD..

Comment 36 Bug Zapper 2009-06-09 14:13:34 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 37 Harald Hoyer 2009-06-30 10:28:19 UTC
still an issue?

Comment 38 Daniel Qarras 2009-06-30 17:21:28 UTC
Yes, with F11 + updates as of 2009-06-30 this is still an issue. The issue is still the same as described in

https://bugzilla.redhat.com/show_bug.cgi?id=496683#c0

Thanks.

Comment 39 Daniel Qarras 2009-10-23 18:05:48 UTC
This is fixed in Fedora 12 Beta, thanks!


Note You need to log in before you can comment on or make changes to this bug.