Bug 208521 - Sandisk USB key exports two LUN's when it should only export one
Sandisk USB key exports two LUN's when it should only export one
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Kernel Maintainer List
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-29 01:11 EDT by Warren Togami
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-03-05 18:17:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
lshal without USB key (90.88 KB, text/plain)
2006-09-29 14:41 EDT, Warren Togami
no flags Details
lshal with USB key (108.37 KB, text/plain)
2006-09-29 14:42 EDT, Warren Togami
no flags Details
udevmonitor showing insert, unmount and removal (5.27 KB, text/plain)
2006-09-29 18:02 EDT, Warren Togami
no flags Details
lshal output with pqi stick (125.22 KB, text/plain)
2007-04-26 23:13 EDT, Peter F. Patel-Schneider
no flags Details
lshal output with pqi stick "active" (125.22 KB, text/plain)
2007-04-26 23:14 EDT, Peter F. Patel-Schneider
no flags Details
Here is the udevmonitor output (3.03 KB, text/plain)
2007-04-27 07:03 EDT, Peter F. Patel-Schneider
no flags Details
output from ps aux | grep id - the vol_id output was trivial so I widened the scope a bit (2.31 KB, text/plain)
2007-04-27 07:05 EDT, Peter F. Patel-Schneider
no flags Details

  None (edit)
Description Warren Togami 2006-09-29 01:11:37 EDT
I have a Sandisk Cruzer 1GB USB flash disk key.

When I plug this into my laptop running GNOME, both "CD-ROM Disc" and "973.4MB
Removable Volume" appear on my desktop.  The latter works fine, the former makes
no sense.

When I unmount the USB disk, then unplug it, then both disappear from the desktop.
Comment 1 Warren Togami 2006-09-29 01:12:37 EDT
kernel-2.6.18-1.2699.fc6
gnome-mount-0.5-2.fc6
Comment 2 David Zeuthen 2006-09-29 02:39:37 EDT
Interesting. Can you reproduce this? Please attach the output of 'lshal
--monitor' running while doing this. Thanks.
Comment 3 Warren Togami 2006-09-29 12:21:07 EDT
Fully reproducible

Start monitoring devicelist:
-------------------------------------------------
usb_device_781_5406_0000060509099364 added
usb_device_781_5406_0000060509099364_if0 added
usb_device_781_5406_0000060509099364_if0_scsi_host added
usb_device_781_5406_0000060509099364_usbraw added
usb_device_781_5406_0000060509099364_if0_scsi_host_scsi_device_lun0 added
usb_device_781_5406_0000060509099364_if0_scsi_host_scsi_device_lun1 added
usb_device_781_5406_0000060509099364_if0_scsi_host_scsi_device_lun1_scsi_generic
added
usb_device_781_5406_0000060509099364_if0_scsi_host_scsi_device_lun0_scsi_generic
added
storage_serial_SanDisk_U3_Cruzer_Micro_0000060509099364 added
storage_serial_SanDisk_U3_Cruzer_Micro_0000060509099364_0 added
volume_empty_unknown added
volume_uuid_B288_271C added
volume_uuid_B288_271C property volume.mount_point = '/media/disk'
volume_uuid_B288_271C property volume.is_mounted = true
volume_uuid_B288_271C property volume.mount_point = ''
volume_uuid_B288_271C property volume.is_mounted = false
usb_device_781_5406_0000060509099364_if0_scsi_host_scsi_device_lun0_scsi_generic
removed
usb_device_781_5406_0000060509099364_if0_scsi_host_scsi_device_lun0 removed
usb_device_781_5406_0000060509099364_if0_scsi_host_scsi_device_lun1_scsi_generic
removed
volume_empty_unknown removed
storage_serial_SanDisk_U3_Cruzer_Micro_0000060509099364_0 removed
usb_device_781_5406_0000060509099364_usbraw removed
usb_device_781_5406_0000060509099364_if0_scsi_host removed
volume_uuid_B288_271C removed
usb_device_781_5406_0000060509099364_if0_scsi_host_scsi_device_lun1 removed
storage_serial_SanDisk_U3_Cruzer_Micro_0000060509099364 removed
usb_device_781_5406_0000060509099364_if0 removed
usb_device_781_5406_0000060509099364 removed
Comment 4 David Zeuthen 2006-09-29 14:14:53 EDT
Very interesting. Can you attach output of lshal when it's plugged in? Thanks
Comment 5 Warren Togami 2006-09-29 14:41:36 EDT
Created attachment 137417 [details]
lshal without USB key
Comment 6 Warren Togami 2006-09-29 14:42:06 EDT
Created attachment 137418 [details]
lshal with USB key
Comment 7 David Zeuthen 2006-09-29 16:33:33 EDT
Thanks. I'm very confused; this looks like it's a kernel bug or perhaps some
werido feature with your Sandisk stick to make it appear as a USB CD-ROM drive
too (vendors like Sandisk loves this kind of value-added crap).

To verify this please attach the output of 'udevmonitor' while plugging in the
stick and removing it. Thanks.
Comment 8 David Zeuthen 2006-09-29 17:03:41 EDT
Also, just because I'm curious, what's the output of 

  /lib/udev/vol_id /dev/scd0

as root when the usb drive is plugged in?
Comment 9 Warren Togami 2006-09-29 18:01:37 EDT
[root@caprica ~]# /lib/udev/vol_id /dev/scd0
ID_FS_USAGE=filesystem
ID_FS_TYPE=iso9660
ID_FS_VERSION=Joliet Extension
ID_FS_UUID=
ID_FS_LABEL=U3 System
ID_FS_LABEL_SAFE=U3_System

Joliet!?  Weird indeed.
Comment 10 Warren Togami 2006-09-29 18:02:27 EDT
Created attachment 137449 [details]
udevmonitor showing insert, unmount and removal
Comment 11 David Zeuthen 2006-09-30 15:03:20 EDT
Reassigning to kernel and fixing up Summary.
Comment 12 David Zeuthen 2007-02-28 22:01:07 EST
I got tired of the kernel driver not being fixed (it's been 5 months) so we now
ignore this device in HAL so the UI don't show the "optical" drive at all

http://gitweb.freedesktop.org/?p=hal-info.git;a=blob;h=0d14053778437060b20b0e9236cf2c5b81f2ce59;hb=302840ec67441f55ba07cae9991538e6c91f7fdc;f=fdi/preprobe/10freedesktop/20-broken-usb-sticks.fdi
Comment 13 David Zeuthen 2007-02-28 22:39:19 EST
Btw, the reason it shows up as a blank disc in HAL (disagreeing with vol_id
probing) is because the CDROM_DISC_STATUS returns CDS_NO_INFO. And then we don't
bother probing for the file system.
Comment 14 David Zeuthen 2007-03-05 18:17:46 EST
This workaround is now in Rawhide so I guess we can close this bug.
Comment 15 Peter F. Patel-Schneider 2007-04-26 18:22:32 EDT
Hmm.  Rawhide doesn't appear to have a very good workaround.

I just loaded F7t4 and popped in a pqi 2GB USB memory stick.  This stick has two
"partitions" - one read-only, with Windoze software, and one usable. 
Unfortunately, the read-only one mounts as a CD-ROM but the other one doesn't.  

Here is a short extract from /var/log/messages

Apr 26 17:05:03 localhost kernel: scsi7 : SCSI emulation for USB Mass Storage
devices
Apr 26 17:05:08 localhost kernel: scsi 7:0:0:0: Direct-Access     Generic  USB
Flash Disk   2.00 PQ: 0 ANSI: 2
Apr 26 17:05:08 localhost kernel: scsi 7:0:0:1: CD-ROM            USB      Flash
CD-ROM     2.00 PQ: 0 ANSI: 0 CCS
Apr 26 17:05:13 localhost kernel: SCSI device sdb: 3958784 512-byte hdwr sectors
(2027 MB)
Apr 26 17:05:13 localhost kernel: sdb: Write Protect is off
Apr 26 17:05:13 localhost kernel: sdb: assuming drive cache: write through
Apr 26 17:05:13 localhost kernel: SCSI device sdb: 3958784 512-byte hdwr sectors
(2027 MB)
Apr 26 17:05:13 localhost kernel: sdb: Write Protect is off
Apr 26 17:05:13 localhost kernel: sdb: assuming drive cache: write through
Apr 26 17:05:13 localhost kernel:  sdb: sdb1
Apr 26 17:05:13 localhost kernel: sd 7:0:0:0: Attached scsi removable disk sdb
Apr 26 17:05:13 localhost kernel: sd 7:0:0:0: Attached scsi generic sg2 type 0
Apr 26 17:05:13 localhost kernel: sr1: scsi-1 drive
Apr 26 17:05:13 localhost kernel: sr 7:0:0:1: Attached scsi generic sg3 type 5
Apr 26 17:05:13 localhost hald: mounted /dev/scd1 on behalf of uid 1316

Comment 16 David Zeuthen 2007-04-26 18:42:16 EDT
Please attach output of lshal. Thanks.
Comment 17 Peter F. Patel-Schneider 2007-04-26 20:25:34 EDT
Here is the output from lshal -m.  I also have the complete lshal device list if
you care.


Start monitoring devicelist:
-------------------------------------------------

19:39:20.470: usb_device_ea0_2168_106C3D57D39C0022 added
19:39:20.609: usb_device_ea0_2168_106C3D57D39C0022_if0 added
19:39:20.615: usb_device_ea0_2168_106C3D57D39C0022_usbraw added
19:39:28.485: usb_device_ea0_2168_106C3D57D39C0022_if0_scsi_host added
19:39:28.487:
usb_device_ea0_2168_106C3D57D39C0022_if0_scsi_host_scsi_device_lun0 added
19:39:30.450:
usb_device_ea0_2168_106C3D57D39C0022_if0_scsi_host_scsi_device_lun0_scsi_generic
added
19:39:30.450:
usb_device_ea0_2168_106C3D57D39C0022_if0_scsi_host_scsi_device_lun1 added
19:39:30.450:
usb_device_ea0_2168_106C3D57D39C0022_if0_scsi_host_scsi_device_lun1_scsi_generic
added
19:39:30.949: storage_serial_USB_Flash_CD_ROM_106C3D57D39C0022 added
19:39:30.972: volume_label_USBNB added
19:39:31.126: volume_label_USBNB property volume.mount_point = '/media/USBNB'
19:39:31.130: volume_label_USBNB property volume.is_mounted_read_only = true
19:39:31.136: volume_label_USBNB property volume.is_mounted = true
19:40:52.394:
usb_device_ea0_2168_106C3D57D39C0022_if0_scsi_host_scsi_device_lun0_scsi_generic
removed
19:40:52.404:
usb_device_ea0_2168_106C3D57D39C0022_if0_scsi_host_scsi_device_lun1_scsi_generic
removed
19:40:52.404:
usb_device_ea0_2168_106C3D57D39C0022_if0_scsi_host_scsi_device_lun0 removed
19:40:52.404: usb_device_ea0_2168_106C3D57D39C0022_if0_scsi_host removed
19:40:52.434: volume_label_USBNB property volume.mount_point = ''
19:40:52.435: volume_label_USBNB property volume.is_mounted_read_only = false
19:40:52.436: volume_label_USBNB property volume.is_mounted = false
19:40:52.446: volume_label_USBNB removed
19:40:52.451: storage_serial_USB_Flash_CD_ROM_106C3D57D39C0022 removed
19:40:52.453:
usb_device_ea0_2168_106C3D57D39C0022_if0_scsi_host_scsi_device_lun1 removed
19:40:52.454: usb_device_ea0_2168_106C3D57D39C0022_if0 removed
19:40:52.454: usb_device_ea0_2168_106C3D57D39C0022_usbraw removed
19:40:52.454: usb_device_ea0_2168_106C3D57D39C0022 removed

Comment 18 David Zeuthen 2007-04-26 21:00:36 EDT
Yes, please include all output of the command 'lshal' (without --monitor). Thanks.
Comment 19 Peter F. Patel-Schneider 2007-04-26 23:13:35 EDT
Created attachment 153572 [details]
lshal output with pqi stick
Comment 20 Peter F. Patel-Schneider 2007-04-26 23:14:03 EDT
Created attachment 153573 [details]
lshal output with pqi stick "active"
Comment 21 Peter F. Patel-Schneider 2007-04-26 23:16:52 EDT
Ok, you asked for it, I've put in an attachment (twice, sorry).

The pqi USB stick is the 106C3D57D39C0022 devices, I believe.

PS:  There seem to be more and more of these sticks with Windoze software in a
read-only partition.
Comment 22 David Zeuthen 2007-04-26 23:53:07 EDT
Thanks for the debug logs - looks weird indeed; just to make sure, can you
attach the output of 'udevmonitor' when plugging in the device? (need to run
this as root). Seems that something is getting stuck somewhere. Thanks.
Comment 23 David Zeuthen 2007-04-26 23:55:04 EDT
Also, after udevmonitor becomes silent - can you attach the output of 'ps
aux|grep vol_id'? Thanks!
Comment 24 Peter F. Patel-Schneider 2007-04-27 07:03:44 EDT
Created attachment 153600 [details]
Here is the udevmonitor output
Comment 25 Peter F. Patel-Schneider 2007-04-27 07:05:44 EDT
Created attachment 153601 [details]
output from ps aux | grep id - the vol_id output was trivial so I widened the scope a bit
Comment 26 David Zeuthen 2007-04-27 12:08:06 EDT
(In reply to comment #24)
> Here is the udevmonitor output

This looks wrong; where are the 

 [UDEV]

lines? I was looking for those because I wanted to check that the driver didn't
hang when udev was running vol_id. Also, please attach the output of
'/lib/udev/vol_id /dev/sdb*'. Thanks.
Comment 27 Peter F. Patel-Schneider 2007-04-27 15:40:31 EDT
Yes, that is weird.  However, running /usr/sbin/udevmonitor as root under a
variety of circumstances results in many UEVENT lines but no UDEV lines.  Maybe
something is different in F7t4?  Running /usr/sbin/udevmonitor in FC6 does
result in UDEV lines (but I've got quite a bit of non-standard stuff in my FC6
setup so output from there is unlikely to be very helpful).

Anyway, here is the result of vol_id 

ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT16
ID_FS_UUID=2436-F6CA
ID_FS_LABEL=RPIUSB
ID_FS_LABEL_SAFE=RPIUSB
Comment 28 David Zeuthen 2007-04-27 15:49:58 EDT
(In reply to comment #27)
> Yes, that is weird.  However, running /usr/sbin/udevmonitor as root under a
> variety of circumstances results in many UEVENT lines but no UDEV lines.  

This suggest that an udev callout is blocking; e.g. udevmonitor prints UEVENT
when it starts to process the event from the kernel and UDEV when it has
finished processing the event. 

So This is most likely vol_id or other tools that investigate the device / file
system and the reason they lock up is normally that a driver and/or hardware is
malfunctioning. 

The bug can be literally anywhere in the stack; for the record there's a bunch
of defect USB host controllers by, I think, VIA (but am not sure) that doesn't
cope well with certain USB keyfob drives. It can also be that the usb_storage
driver can't handle the device and it needs a few quirk entries here and there.

Is it possible you can try it on other hardware just to check that it's not the
USB mass-storage device itself? Thanks.

> Running /usr/sbin/udevmonitor in FC6 does
> result in UDEV lines

And it works fine on FC6? If so, it's very likely it's a driver regression from
the FC6 kernel to the FC7 kernel...
Comment 29 Peter F. Patel-Schneider 2007-04-27 16:16:26 EDT
You may have misunderstood.

udevmonitor in FC6 produces lots of UDEV lines in FC6.  For example, here is
output from putting in a standard USB key:

UEVENT[1177704487.247076] add@/devices/pci0000:00/0000:00:1d.7/usb5/5-5
UEVENT[1177704487.249533] add@/class/usb_endpoint/usbdev5.5_ep00
UEVENT[1177704487.249562] add@/devices/pci0000:00/0000:00:1d.7/usb5/5-5/5-5:1.0
UEVENT[1177704487.249577] add@/class/scsi_host/host6
UEVENT[1177704487.249590] add@/class/usb_endpoint/usbdev5.5_ep01
UEVENT[1177704487.249603] add@/class/usb_endpoint/usbdev5.5_ep81
UEVENT[1177704487.249616] add@/class/usb_device/usbdev5.5
UDEV  [1177704487.252607] add@/devices/pci0000:00/0000:00:1d.7/usb5/5-5
UDEV  [1177704487.258694] add@/class/usb_endpoint/usbdev5.5_ep00
UDEV  [1177704487.260396] add@/class/usb_endpoint/usbdev5.5_ep01
UDEV  [1177704487.271856] add@/class/usb_endpoint/usbdev5.5_ep81
UDEV  [1177704487.565229] add@/devices/pci0000:00/0000:00:1d.7/usb5/5-5/5-5:1.0
UDEV  [1177704487.781122] add@/class/scsi_host/host6
UDEV  [1177704487.795138] add@/class/usb_device/usbdev5.5
UEVENT[1177704492.249509]
add@/devices/pci0000:00/0000:00:1d.7/usb5/5-5/5-5:1.0/host6/target6:0:0/6:0:0:0
UEVENT[1177704492.249546] add@/class/scsi_disk/6:0:0:0
UEVENT[1177704492.255788] add@/block/sdf
UEVENT[1177704492.255877] add@/block/sdf/sdf1
UEVENT[1177704492.255891] add@/class/scsi_device/6:0:0:0
UEVENT[1177704492.255968] add@/class/scsi_generic/sg5
UDEV  [1177704492.376356]
add@/devices/pci0000:00/0000:00:1d.7/usb5/5-5/5-5:1.0/host6/target6:0:0/6:0:0:0
UDEV  [1177704492.583149] add@/class/scsi_disk/6:0:0:0
UDEV  [1177704492.610193] add@/class/scsi_device/6:0:0:0
UDEV  [1177704492.615155] add@/class/scsi_generic/sg5
UDEV  [1177704492.731181] add@/block/sdf
UDEV  [1177704492.989179] add@/block/sdf/sdf1
UEVENT[1177704493.313465] mount@/block/sdf/sdf1
UDEV  [1177704493.314522] mount@/block/sdf/sdf1

However, in F7t4 udevmonitor doesn't produce any UDEV lines under the same
situation, even though the USB stick is picked up correctly in both cases,
mounted, and put on the desktop.

The pqi stick doesn't work right in both FC6 and F7t4.  In both cases, the
R-only partition is mounted but not the R/W one.  This is on a Thinkpad T60p, by
the way, so I think that hardware issues are not very likely.

I actually patched the problem in FC6 by adding
/usr/share/hal/fdi/policy/20thirdparty/50-usb-pqi.fdi:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
  <device>

    <match key="info.bus" string="scsi">
      <match key="info.parent" contains="106C3D57D39C0022">
            <merge key="scsi.type" type="string">disk</merge>
      </match>
    </match>

    <match key="volume.fsusage" string="filesystem">
      <match key="volume.label" string="USBNB">
        <merge key="volume.ignore" type="bool">true</merge>
      </match>
    </match>

  </device>
</deviceinfo>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

I haven't tried this out in F7t4, hoping that a general fix was possible. 

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