Bug 1687254 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

It would be even better to load all directory entries into an array and then iterate the array. Some time ago I experienced a problem described in bug 1638831. However, I currently can't quickly reproduce it again. My conclusion was that in general it's not a good idea to modify stuff on disk during direct directory traversals. `GetBodyUsage` seems to remove entries during traversals.
The array could later also contain information like isDirectory, so the final consumer wouldn't have to consider the case when the file was already removed, etc.
This would provide a middle-step between current QM and QMv4 which won't do any directory traversals (only in recovery mode when the main storage.sqlite is lost).
There's already a case when we load directory entries into memory structures:
https://searchfox.org/mozilla-central/rev/dac45cc7020dfddbcc937827810dd11550c07dc3/dom/indexedDB/ActorsParent.cpp#13414
The case in bug 1638831 was/is quite concerning because if a directory traversal prematurely finish, the temporary storage initialization doesn't have to fail because of that, but our quota management can become broken later, because we didn't load all information about files.
However, this doesn't belong directly to this bug, that's why I asked about "strategy".
It would be even better to load all directory entries into an array and then iterate the array. Some time ago I experienced a problem described in bug 1638831. However, I currently can't quickly reproduce it again. My conclusion was that in general it's not a good idea to modify stuff on disk during direct directory traversals. `GetBodyUsage` seems to remove entries during traversals.
The array could later also contain information like isDirectory, so the final consumer wouldn't have to consider the case when the file was already removed, etc.
This would provide a middle-step between current QM and QMv4 which won't do any directory traversals (only in recovery mode when the main storage.sqlite is lost).
There's already a case when we load directory entries into memory structures:
https://searchfox.org/mozilla-central/rev/dac45cc7020dfddbcc937827810dd11550c07dc3/dom/indexedDB/ActorsParent.cpp#13414
The case in bug 1638831 was/is quite concerning because if a directory traversal prematurely finishes, the temporary storage initialization doesn't have to fail because of that, but our quota management can become broken later, because we didn't load all information about files.
However, this doesn't belong directly to this bug, that's why I asked about "strategy".

Back to Bug 1687254 Comment 3