On 09/03/2017 10:11 PM, Michael Sevakis wrote:
So how about adding the dirchache.size != 0 condition there to not update
last_size if size is  0? Like this:
https://github.com/dreamlayers/rockbox/commit/d438eb3b9ee9a824e2cac85aaa306c3891694e3a

Hmmm... .size isn't going to be zero at that point if there's been even
one entry added by the scanner.

Yet dircache.size was zero when I put a splashf() there and shut down while the background dircache scan was going on. The change above also fixes the problem of needing a foreground dircache build after shutting down early.

I'm thinking clean_shutdown() -> system_flush() -> tree_flush() -> dircache_suspend() -> dircache_suspend_internal() -> reset_cache() sets it to zero.

If the scanning had finished, then build_volumes() would have finished and set last_size already, and that would persist after the reset_cache().

Reply via email to