Hi<div><br></div><div>We have linux-2.6.35 based device. Device has removable SD-card, which by certain condition is shared to PC vis USB connection using g_file_storage driver. Everything if fine, but when I manualy eject sd-card from cardholder, on my linux host machine, sd-card partition is still being mounted. In sources, there is a note, that if pass 'removable' parametr to g_file_storage module, locations specified by 'file' argument could be unmounted from sysfs by writing zero string to 'file'. But when try to do so, removal attempt is rejected in drivers/usb/gadget/storage_common.c:fsg_store_file() by first if-condition.</div>
<div><div>755 if (curlun->prevent_medium_removal && fsg_lun_is_open(curlun)) {</div><div>756 printk("eject attempt prevented\n");</div><div>757 return -EBUSY; /* "Door is locked" */</div>
<div>758 }</div></div><div>As far as I understand, my host-pc blocks driver to eject certain LUN.</div><div><br></div><div>Here is my parametrs to insert module</div><div><div><div>insmod /lib/modules/g_file_storage.ko stall=0 removable=1 file=/dev/mmcblk0p4,/dev/mmcblk1p1 ro=0,0</div>
</div></div><div>where /dev/mmcblk0p4 is device internal memory (chip is soldered to pcb, so it can not be ejected)</div><div>and /dev/mmcblk1p1 is removable sd-card</div><div><br></div><div>Is there any way to perform `force eject` for one of my LUNs ?</div>
<div><br></div><div>Thank you</div><div><br></div>