kernel/vm: Fix copy/paste bug in vm_cache_acquire_locked_page_cache.

This fixes a regression from 9e89f7c068c3b3b4c9d74bb82679c27a2c12b10a.

Even if SwitchFromReadLock fails, the original read lock has been released,
and so we need to re-acquire the lock before continuing.

Should fix a KDL reported by X512.
This commit is contained in:
Augustin Cavalier 2024-09-21 11:47:21 -04:00
parent cd333360b3
commit eb26bd6c47

View File

@ -593,7 +593,7 @@ vm_cache_acquire_locked_page_cache(vm_page* page, bool dontWait)
VMCache* cache = cacheRef->cache;
if (!cache->SwitchFromReadLock(&sCacheListLock)) {
// cache has been deleted
rw_lock_read_unlock(&sCacheListLock);
rw_lock_read_lock(&sCacheListLock);
continue;
}