Bug 496683 - udev fails to detect filesystem on fake cdrom drive
udev fails to detect filesystem on fake cdrom drive
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: udev (Show other bugs)
11
All Linux
low Severity urgent
: ---
: ---
Assigned To: Harald Hoyer
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-20 13:40 EDT by Daniel Qarras
Modified: 2010-01-11 10:56 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-10-23 14:05:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Daniel Qarras 2009-04-20 13:40:38 EDT
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 13:45:01 EDT
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 13:48:43 EDT
Fixing component (not my day).
Comment 3 David Zeuthen 2009-04-20 15:18:08 EDT
Please include the information mentioned here

 http://www.freedesktop.org/wiki/Software/DeviceKit-disks
Comment 4 Daniel Qarras 2009-04-20 15:52:27 EDT
Thanks for looking into this. I will attach 5 attachment generated based on the instructions.
Comment 5 Daniel Qarras 2009-04-20 15:52:59 EDT
Created attachment 340418 [details]
proc-self-mountinfo.txt
Comment 6 Daniel Qarras 2009-04-20 15:53:17 EDT
Created attachment 340419 [details]
devkit-disks--dump.txt
Comment 7 Daniel Qarras 2009-04-20 15:53:35 EDT
Created attachment 340420 [details]
devkit-disks--monitor-detail.txt
Comment 8 Daniel Qarras 2009-04-20 15:53:51 EDT
Created attachment 340421 [details]
gvfs-mount-li.txt
Comment 9 Daniel Qarras 2009-04-20 15:54:09 EDT
Created attachment 340422 [details]
gvfs-mount-oi.txt
Comment 10 David Zeuthen 2009-04-20 16:10:40 EDT
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 16:25:01 EDT
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 16:25:32 EDT
Created attachment 340430 [details]
dmesg-related.txt
Comment 13 Daniel Qarras 2009-04-20 16:25:52 EDT
Created attachment 340431 [details]
udevadm-monitor--env.txt
Comment 14 David Zeuthen 2009-04-20 16:57:55 EDT
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 17:06:02 EDT
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 17:23:46 EDT
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 17:24:26 EDT
Fixing up summary.
Comment 18 David Zeuthen 2009-04-20 17:30:42 EDT
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 17:59:32 EDT
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 15:20:18 EDT
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 05:10:16 EDT
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 06:03:02 EDT
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 05:36:37 EDT
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 09:08:01 EDT
What does:
  /lib/udev/cdrom_id -d /dev/sr1
print?
Comment 25 Daniel Qarras 2009-05-24 10:04:50 EDT
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 12:11:36 EDT
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 14:48:57 EDT
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-24 20:21:49 EDT
Oh, that should be fine. The default rules are in /lib/udev/.
Comment 29 Harald Hoyer 2009-05-25 03:39:21 EDT
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 03:39:45 EDT
$ rpm -q udev
udev-141-3.fc11.x86_64
Comment 31 Kay Sievers 2009-05-25 07:15:23 EDT
Ok, if that's in, what does:
  udevadm test /class/block/sr1
print?
Comment 32 Daniel Qarras 2009-05-25 17:16:52 EDT
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 17:17:25 EDT
Created attachment 345358 [details]
udevadm-test-class-block-sr1.txt
Comment 34 Kay Sievers 2009-05-25 17:43:03 EDT
The udev side seems fine, it reports a filesystem:
  'ID_FS_USAGE=filesystem'
  'ID_FS_TYPE=iso9660'
Comment 35 Daniel Qarras 2009-05-25 17:53:45 EDT
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 10:13:34 EDT
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 06:28:19 EDT
still an issue?
Comment 38 Daniel Qarras 2009-06-30 13:21:28 EDT
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 14:05:48 EDT
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.