Problem with mounting a device second time.

ali nasir supremenasir at yahoo.com
Thu Apr 19 07:15:28 UTC 2012


Hi,

1. Before calling the ioctl, we ensure that all the files are closed using the fclose.
2. If we do the ioctl, the unmount() is still succesfull.
3. How do i find the remaining user of the disk? Is there a struct where i can see something?

Regards,
Ali

------------------------------
On Thu 19 Apr, 2012 12:14 PM IST Sebastian Huber wrote:

>On 04/19/2012 08:10 AM, ali nasir wrote:
>> What we do is the following:
>> 1. With the SD card inserted, we write a set of files (4 to 5 files) on the card. After all the fwrite(..) has returned, we call the ioctl for the RTEMS_BLKIO_SYNCDEV to ensure that the data is written to the card.
>
>You should close all files before the ioctl to make sure that all buffers of 
>the IO library are flushed.
>
>> 2. We then unmount the card by calling the below set of functions:
>> unmount
>> rmdir
>> rtems_bdbuf_syncdev
>> rtems_disk_delete
>> rtems_bdbuf_purge_dev
>> rtems_io_unregister_driver
>>
>> When we step in in the rtems_disk_delete function, the free_disk_device() is not called as the dd->uses equals 1.
>
>This means someone is still using this disk.  You should figure out this user.
>
>> 3. After this, if we insert the second card, after removing the first, then the second card fails in the create_phys by returning 12
>
>Yes, this is because the first disk is still in use.
>
>>
>> 4. When we do not call the ioctl for the RTEMS_BLKIO_SYNCDEV, then we are succesfully able to unmount and also mount the second card.
>
>Is the unmount() not successful if you do the ioctl?
>
>>
>> Should we remove the call to the ioctl for the RTEMS_BLKIO_SYNCDEV? or is there some other solution to the problem?
>> Please guide.
>
>The solution is to track down the remaining disk user.
>
>-- 
>Sebastian Huber, embedded brains GmbH
>
>Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
>Phone   : +49 89 18 90 80 79-6
>Fax     : +49 89 18 90 80 79-9
>E-Mail  : sebastian.huber at embedded-brains.de
>PGP     : Public key available on request.
>
>Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>_______________________________________________
>rtems-users mailing list
>rtems-users at rtems.org
>http://www.rtems.org/mailman/listinfo/rtems-users





More information about the users mailing list