Problem with mounting a device second time.

ali nasir supremenasir at yahoo.com
Mon Apr 23 04:34:28 UTC 2012


Hi,

I tried to debug further. I see the following when i put breakpoints in the rtems_disk_obtain and the rtems_disk_release. I enable these breakpoints when the control is in the rtems_blkdev_generic_ioctl, just before the call to rtems_bdbuf_syncdev.
In idle state (no file operations), the dd->uses equals 2.
1. First the obtain is called from the ioctl. the uses increase from 3 to 4. 
2. Then the release is called from swapout task. The uses now decrease from 4 to 3.
3. Swapout task calls the obtain. The uses now increase from 3 to 4.
4. Swapout task calls release. uses now decrease from 4 to 3. 
5. ioctl call the release. Swapout decreases from 3 to 2. 

After this if i call the bdls, then the uses show 3. But there is no call to the obtain after step 5 above.

I also notice, that when i call the ioctl, the swapout task is still writing data to the card. Is is that calling the SYNCDEV ioctl while the swapout taks is also working on the same device causes some problems. This because i do not face any problem when the bdbuf_syncdev is called during the unmount sequence. 

Regards,
Ali





------------------------------
On Thu 19 Apr, 2012 5:29 PM IST Sebastian Huber wrote:

>On 04/19/2012 01:09 PM, ali nasir wrote:
>> Here is the output before the call to ioctl:
>> ff:ffffffff P /dev/rda UC=4294967293 BB=0 BC=4000 BS=512 MBS=512
>> 00000001:00000000 P /dev/nvda UC=4294967293 BB=0 BC=637 BS=512 MBS=512
>> 00000004:00000000 P /dev/fdda UC=1 BB=0 BC=1504 BS=512 MBS=512
>> 00000005:00000000 P /dev/sdc0 UC=2 BB=0 BC=3862528 BS=512 MBS=512
>> 00000007:00000000 L /dev/sdc01 UC=2 BB=135 BC=3858489 BS=512 MBS=512
>> 
>> Here is the output after the call to the ioctl.
>> ffffffff:ffffffff P /dev/rda UC=4294967293 BB=0 BC=4000 BS=512 MBS=512
>> 00000001:00000000 P /dev/nvda UC=4294967293 BB=0 BC=637 BS=512 MBS=512
>> 00000004:00000000 P /dev/fdda UC=1 BB=0 BC=1504 BS=512 MBS=512
>> 00000005:00000000 P /dev/sdc0 UC=2 BB=0 BC=3862528 BS=512 MBS=512
>> 00000007:00000000 L /dev/sdc01 UC=3 BB=135 BC=3858489 BS=512 MBS=512
>> 
>> The UC for /dev/sdc01 has increased by one. This only happens if i call the ioctl for the SYNCDEV. Any idea what could i be missing?
>
>If you call the ioctl more than once, does it increase further?  The usage count increases with a rtems_disk_obtain() and decreases with a rtems_disk_release().  Thus someone holds a reference to the disk after the ioctl call.  You can set a break point to these two functions.
>
>-- 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