Hot unplugging a device in the middle of a read

Adrian McMenamin lkmladrian at gmail.com
Tue Jan 13 19:52:10 EST 2009


2009/1/13 Adrian McMenamin <lkmladrian at gmail.com>:
> 2009/1/12 Adrian McMenamin <lkmladrian at gmail.com>:
>> I am working on a map driver for the virtual memory unit (VMU) flash
>
>> [  184.277538] Removing MTD device #0 (vmu1.1.0) with use count 1
>
> Having looked through the sources I can see that this is indicating
> there is an additional user in play - because when I pull the VMU out
> when not in the middle of the initial reads I don't get this message
> (as use count is obviously 0) even though the code path is the same.
>
> Can I just put in an extra 'put'? Or is there some other way of doing this?
>

For the sake of completeness for those searching on google - I wrote a
function that checks if the usecount > 0, if it is, then I just have
to live with the block read errors but I don't crash the system
because I don't delete the mtd_info



More information about the linux-mtd mailing list