This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10913 - File Browser not updated properly upon microSD insert/removal with dircache enabled
Attached to Project:
Rockbox
Opened by Michael Chicoine (mc2739) - Thursday, 14 January 2010, 16:43 GMT+2
Last edited by amaury pouly (pamaury) - Friday, 21 May 2010, 11:28 GMT+2
Opened by Michael Chicoine (mc2739) - Thursday, 14 January 2010, 16:43 GMT+2
Last edited by amaury pouly (pamaury) - Friday, 21 May 2010, 11:28 GMT+2
|
DetailsWith dircache disabled, if you are in the file browser and insert or remove the microSD card it will consistently update the list by adding <microSD1> on insert and removing it when the card is removed.
With dircache enabled, the list is not consistently updated. Tested with r24224 and as old as r22000 on e280v1 Tested with r24224 on e260v2 Process to reproduce: 1. Boot and clear all settings 2. Enable dircache setting 3. Power off and reboot 4. Enter the file browser by selecting Files on the Main Menu 5. Insert and remove microSD card and observe the Files list If the microSD card was not inserted on boot, the list is not updated on the first insert. After the card is removed, subsequent inserts/removals seem to update properly. If the microSD card was inserted on boot, the list is not updated on the first removal. Upon insert, the list may or may not update. The updates are very inconsistent on subsequent inserts/removals. If you exit the file browser and then reenter, the correct state is shown. |
This task depends upon
Closed by amaury pouly (pamaury)
Friday, 21 May 2010, 11:28 GMT+2
Reason for closing: Fixed
Additional comments about closing: r26222
Friday, 21 May 2010, 11:28 GMT+2
Reason for closing: Fixed
Additional comments about closing: r26222
On microSD insertion/removal, SYS_FS_CHANGED (SFC) is triggered. This SFC message is used in two placed:
- in the file browser (tree.c:dirbrowse) (1)
=> it triggers a complete reload of the current directory and a complete redraw
- in the dircache thread (dircache.c:dircache_thread) (2)
=> it disables dircache and ask for a transparent rebuild
Now, the problem is the synchronization because if (1) happen before (2), (1) will call ft_load that will ask dircache to opendir/readdir the current directory, but as (2) as not yet happened, dircache is still enabled and thus the sd insertion has not yet been taken into the dircache subsystem.
So the solution is to make sure that (2) happens before (1).