Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! fscache: optimize fscache_clear()
fscache_clear was crashing because when using hashmap_iter_next method the next entry will be saved. Meanwhile the call to fscache_release will free the directory and the list of entries for the directory. This causes the next entry saved by the iter to be freed, invalid and the crash with the next loop iteration. This changes the clear to simple call hashmap_free to free the hashmap and all the entries and then call hashmap_init to reinitialize the hashmap for the next fscache use. The reason this is safe is fscache_clear is only called from fscache_enable when this cache is being disabled which is only called in preload_index after all the thread have exited. It is also guarded by the critical section mutex. Signed-off-by: Kevin Willford <kewillf@microsoft.com>
- Loading branch information