Re: usb-storage && iRIVER flash player problem

From: Javier Marcet
Date: Mon Jan 05 2004 - 15:05:07 EST


* Matthew Dharm <mdharm-kernel@xxxxxxxxxxxxxxxxxx> [040105 20:02]:

It looks like your device is choking over the ALLOW_MEDIUM_REMOVAL command
-- I've never seen a device broken in this particular way before.

If you edit drivers/scsi/sd.c to remove the sending of that command (it's
normally used to lock the media-eject button on devices that support it),
we should be able to test this theory. If this is the case, then we may
need to modify the SCSI layer to only send that command if the RMB bit is
set.

That did it, with this fix I have no problems. fdisk still reports
mangled partitions, parted OTOH reports one partition filling the whole
device. I can mount either /dev/sda or /dev/sda4 and get the same
correct results.

Thanks a lot :) You've made me happy for the coming days ;)
Until your message I was messing around with unusual_devs.h to no
avail...


--
Javier Marcet <javier@xxxxxxxxxxx>
--- linux/drivers/scsi/scsi_ioctl.c.orig 2004-01-01 09:12:20.000000000 +0100
+++ linux/drivers/scsi/scsi_ioctl.c 2004-01-05 20:42:03.979349544 +0100
@@ -156,7 +156,7 @@
if (!sdev->removable || !sdev->lockable)
return 0;

- scsi_cmd[0] = ALLOW_MEDIUM_REMOVAL;
+ scsi_cmd[0] = 0;
scsi_cmd[1] = 0;
scsi_cmd[2] = 0;
scsi_cmd[3] = 0;