Alan, On May 23, 2012, at 7:56 PM, Alan Stern wrote: > On Wed, 23 May 2012, Pantelis Antoniou wrote: > >>> Of course, you always have the option of not specifying the >>> "removable=y" module parameter when loading the gadget originally. >>> Without that parameter, the backing file won't get closed when the >>> eject command is received. >>> >> >> Unfortunately this has been tried, and what it does is canceling the >> unmount. So the disk remains perpetually mounted. > > I don't believe that. Are you sure you haven't mixed up unmounting and > ejecting? > I'm using the Finder; I don't fiddle with the command line. I see an eject icon, I press it, and the disk should umount/eject. On the Mac it's all integrated, there's no separate unmount/eject steps. Speaking of which, I did try to replicate the behavior of the Mac on Linux. Using udisks to send a detach command I get to see this on the console: > May 23 17:55:48 beagleboard [ 335.725341] lun0: unload attempt prevented > May 23 17:55:48 beagleboard [ 335.725372] gadget: sending command-failure status > And this is the result on the host: > root@ubuntu:~# sudo udisks --detach /dev/sdb > Detach failed: Error detaching: helper exited with exit code 1: Detaching device /dev/sdb > USB device: /sys/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-1) > SYNCHRONIZE CACHE: OK > STOP UNIT: FAILED: No such file or directory > So udisks does send a STOP UNIT command too. Which fails because there was a previous command that disallowed media unmounting. I does sound like we have a code path (STOP UNIT command) that wasn't been exercised at all on Linux hosts, but on the Mac it is being exercised with unexpected results. > For example, what happens when you plug in a regular USB flash memory > stick to an OS-X system? Many of them them are not removable. (More > accurately, none of them are removable and many of them -- but not all! > -- correctly tell the host that they aren't.) Is it then impossible to > unmount such a flash drive? > Most of the USB flash memory sticks I've used on the Mac operate perfectly fine. You click the eject button and they unmount cleanly. There is a strong case to be made that a Linux based device that presents a mass memory interface should work in the same manner. >> It is what it is then. It is very bad from a user perspective. >> >> Any chance to have a module parameter that selects this behavior, with >> it being defaulted to no? > > Not until I'm completely convinced it is necessary. > > Alan Stern > Regards -- Pantelis -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html