[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#290398: usb_storage issue: A (not so) funny way to (or to not) delete files.



Subject: usb_storage issue: A (not so) funny way to (or to not) delete files.
Package: kernel-image-2.6.8-1-386
Version: 2.6.8-10
Severity: grave

1) Kernel 

ii  kernel-image-2.6.8-1-386     2.6.8-10   Linux kernel image for version 2.6.8 on 386.
ii  kernel-image-2.6.8-1-686     2.6.8-10   Linux kernel image for version 2.6.8 on PPro/Celeron/PII/PIII/PIV.
ii  kernel-image-2.6.8-1-686-smp 2.6.8-10   Linux kernel image for version 2.6.8 on PPro/Celeron/PII/PIII/PIV SMP.
ii  kernel-image-2.6.10-686-smp  01.vanilla Linux kernel binary image for version 2.6.10-686-smp.

2) Usb storage device physically set to read only

3) Mount it as rw (mount -o rw /dev/sdc1 /media/usb), file system is vfat.

4) mv my_favorite_file /media/usb && echo success
   success
   
5) sync

6) A lot of errors in messages:
SCSI error : <2 0 0 0> return code = 0x8000002
Current sda: sense key Data Protect
Additional sense: Write protected
end_request: I/O error, dev sda, sector 566
Buffer I/O error on device sda1, logical block 509
lost page write due to I/O error on sda1

7) ls -la /media/usb/my_favorite_file
ls: /media/usb/my_favorite_file: No such file or directory

8) The same for rm, the deleted files magically appear after a sync

9) Additionally, but only if the file are a lot (100) and large
   (2MByte each one) the sync may take a long time (2 hours)
   
10) Additionaly after the 2 hour sync I have a oops after unmounting
    and disconneting and reconnectting the usb memory.
    
usb 5-1: USB disconnect, address 5
slab error in kmem_cache_destroy(): cache `scsi_cmd_cache': Can't free all objects
 [<c0147516>] kmem_cache_destroy+0xd6/0x120
 [<f8a054e9>] scsi_destroy_command_freelist+0x59/0x90 [scsi_mod]
 [<f8a06782>] scsi_host_dev_release+0x32/0xa0 [scsi_mod]
 [<c0208d1b>] device_release+0x5b/0x60
 [<c029cdca>] preempt_schedule+0x2a/0x50
 [<c01b5858>] kobject_cleanup+0x98/0xa0
 [<f8d74e08>] usb_stor_release_resources+0xe8/0x120 [usb_storage]
 [<f8d75159>] storage_disconnect+0x69/0x79 [usb_storage]
 [<f8bd8106>] usb_unbind_interface+0x76/0x80 [usbcore]
 [<c020a0b6>] device_release_driver+0x66/0x70
 [<c020a335>] bus_remove_device+0x65/0xb0
 [<c02090af>] device_del+0x5f/0xb0
 [<f8bdf538>] usb_disable_device+0xc8/0x110 [usbcore]
 [<f8bda3f6>] usb_disconnect+0xb6/0x170 [usbcore]
 [<f8bdb545>] hub_port_connect_change+0x3f5/0x430 [usbcore]
 [<f8bd90a7>] clear_port_feature+0x57/0x60 [usbcore]
 [<f8bdb823>] hub_events+0x2a3/0x3f0 [usbcore]
 [<f8bdb9a5>] hub_thread+0x35/0x120 [usbcore]
 [<c011e420>] autoremove_wake_function+0x0/0x60
 [<c01060d2>] ret_from_fork+0x6/0x14
 [<c011e420>] autoremove_wake_function+0x0/0x60
 [<f8bdb970>] hub_thread+0x0/0x120 [usbcore]
 [<c01042c5>] kernel_thread_helper+0x5/0x10
usb 5-2: new full speed USB device using address 6
kmem_cache_create: duplicate cache scsi_cmd_cache
------------[ cut here ]------------
kernel BUG at mm/slab.c:1382!
invalid operand: 0000 [#1]
PREEMPT SMP
Modules linked in: nls_iso8859_1 nls_cp437 sd_mod usb_storage mousedev tsdev psmouse videodev radeon nfsd exportfs rfcomm l2cap bluetooth af_packet parport_pc lp parport thermal fan button processor ac battery ipv6 nfs lockd sunrpc 8139cp hw_random uhci_hcd pciehp shpchp pci_hotplug intel_agp intel_mch_agp agpgart evdev ehci_hcd usbcore eth1394 snd_intel8x0 snd_ac97_codec snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_page_alloc gameport snd_mpu401_uart snd_rawmidi snd_seq_device snd soundcore e1000 ohci1394 8139too mii crc32 dm_mod capability commoncap w83627hf eeprom i2c_sensor i2c_isa i2c_i801 i2c_core sr_mod sbp2 scsi_mod ieee1394 ide_cd cdrom rtc vfat fat ext2 ext3 jbd mbcache ide_generic ide_disk piix ide_core unix font vesafb cfbcopyarea cfbimgblt cfbfillrect
CPU:    0
EIP:    0060:[<c0147016>]    Not tainted
EFLAGS: 00010202   (2.6.8-1-686-smp)
EIP is at kmem_cache_create+0x426/0x5d0
eax: 00000032   ebx: f6f6cd10   ecx: c039e158   edx: c02d9fbc
esi: f8a107af   edi: f8a107af   ebp: f6f6cb80   esp: f77d5d54
ds: 007b   es: 007b   ss: 0068
Process khubd (pid: 1093, threadinfo=f77d4000 task=f7778d70)
Stack: c02b1060 f8a107a0 00000080 00002000 f77d5d78 f6f6cbd8 0000000a c0000000
       ffffff80 00000080 f7b21800 f8a22700 f7b21810 f8a22728 f8a05407 f8a107a0
       0000015c 00000080 00002000 00000000 00000000 000001e8 f7b21800 f7b219e8
Call Trace:
 [<f8a05407>] scsi_setup_command_freelist+0x77/0x100 [scsi_mod]
 [<f8a069cb>] scsi_host_alloc+0x1db/0x2e0 [scsi_mod]
 [<f8d74c67>] usb_stor_acquire_resources+0x77/0x130 [usb_storage]
 [<f8d7501b>] storage_probe+0x14b/0x220 [usb_storage]
 [<f8bd807d>] usb_probe_interface+0x5d/0x70 [usbcore]
 [<c0209edf>] bus_match+0x3f/0x70
 [<c0209f4f>] device_attach+0x3f/0xa0
 [<c020a27c>] bus_add_device+0x5c/0xb0
 [<c0208f61>] device_add+0xa1/0x130
 [<f8bdfbf3>] usb_set_configuration+0x2f3/0x45b [usbcore]
 [<f8bda612>] usb_new_device+0xb2/0x170 [usbcore]
 [<f8bdb37c>] hub_port_connect_change+0x22c/0x430 [usbcore]
 [<f8bdb823>] hub_events+0x2a3/0x3f0 [usbcore]
 [<f8bdb9a5>] hub_thread+0x35/0x120 [usbcore]
 [<c011e420>] autoremove_wake_function+0x0/0x60
 [<c01060d2>] ret_from_fork+0x6/0x14
 [<c011e420>] autoremove_wake_function+0x0/0x60
 [<f8bdb970>] hub_thread+0x0/0x120 [usbcore]
 [<c01042c5>] kernel_thread_helper+0x5/0x10
Code: 0f 0b 66 05 de 07 2b c0 8b 0b e9 5b ff ff ff 8b 47 50 c7 04    


Note: I don't try to reproduce Points 9) and 10). The kernel
      in this case (as you see) was kernel-image-2.6.10-686-smp

The kernel-image-2.6.10-686-smp  01.vanilla is a custom compiled vanilla
kernel (base from debian 686-smp + make oldconfig (all as module))

Severity is set to grave since this bug can cause data loss.

Only for reference: try to mount the memory on with the mandrake kernel
2.6.8.1-13mdk and mount reply with an error:
mount: block device /dev/sdc1 is write protected, mountig read-only.

With the debian kernel you can also mount -o rw /dev/cdrom0,
mount | grep cdrom
/dev/cdrom0 on /media/cdrom0 type iso9660 (rw,noexec,nosuid,nodev)
after you get a error during writing 
cp: cannot create regular file `/media/cdrom/file': Read-only file system

I you have any quesition, please reply.

Best Regards,
Daniele
      
-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-686-smp
Locale: LANG=it_IT@euro, LC_CTYPE=it_IT@euro (charmap=ISO-8859-15)

Versions of packages kernel-image-2.6.8-1-386 depends on:
ii  coreutils [fileutils]         5.2.1-2    The GNU core utilities
ii  initrd-tools                  0.1.76     tools to create initrd image for p
ii  module-init-tools             3.1-rel-2  tools for managing Linux kernel mo

-- no debconf information



Reply to: