Closed hradec closed 4 years ago
With this change, I can just re-mount to retrieve up-to-date files from the backend. Without this change, a re-mount would cause mcachefs to be extremely slow since all updated files in the backend would be transferred again on every read.
Ok, I just realized this change only works with my previous pull request #20 applied, which detects changes in file size between cached files and the up-to-date metadata (which holds the current file size of files in the backend after a re-mount).
So this pull request is part of #20 pull request.
as this one is part of pull request #20, I'm closing this one for now as well.
when re-mounting mcachefs with previously cached files, originally mcachefs_transfer_do_backing detects a file already in cache and would throw an error, forcing mcachefs to always use the source file instead of updating the local cache.
This change just reports that the already cached file exists and it's older than the source, and instead of returning and forcing mcachefs to use the source file, it will continue and update the file in the cache, so subsequent reading will be done from the cache as it should.