nfs4: Disable file cache to invalidate it
* When resetting the file cache, use file_cache_disable() to remove all pages, instead of calling file_cache_delete(). * Possible fix for #19656. file_cache_delete doesn't actually delete the VMCache object, so when file_cache_create() is called the returned file_cache_ref just points to the same VMCache as before. Change-Id: Ifba42b51c52f11980fd97212d0c3bdfdc1e55085 Reviewed-on: https://review.haiku-os.org/c/haiku/+/9448 Tested-by: Commit checker robot <[email protected]> Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
@@ -173,14 +173,19 @@ Inode::RevalidateFileCache()
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
SyncAndCommit(true);
|
SyncAndCommit(true);
|
||||||
|
|
||||||
file_cache_delete(fFileCache);
|
result = file_cache_disable(fFileCache);
|
||||||
|
if (result != B_OK) {
|
||||||
|
INFORM("RevalidateFileCache: failed to disable cache\n");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
fMetaCache.InvalidateStat();
|
fMetaCache.InvalidateStat();
|
||||||
result = Stat(&st);
|
result = Stat(&st);
|
||||||
if (result == B_OK)
|
if (result == B_OK)
|
||||||
fMaxFileSize = st.st_size;
|
fMaxFileSize = st.st_size;
|
||||||
fFileCache = file_cache_create(fFileSystem->DevId(), ID(), fMaxFileSize);
|
file_cache_set_size(fFileCache, fMaxFileSize);
|
||||||
|
file_cache_enable(fFileCache);
|
||||||
|
|
||||||
fChange = change;
|
fChange = change;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user