From 222b8cf7b746f1f5406a21a1ca5b87458de6daf2 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 18 May 2011 10:13:44 +0000 Subject: [PATCH] cache_io(): Since satisfy_cache_io() (respectively the function it calls) unlocks the cache, we have to look up the page again, since someone else could have removed it in the meantime. Possibly fixes #7514. +r1alpha3 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41564 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/cache/file_cache.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/cache/file_cache.cpp b/src/system/kernel/cache/file_cache.cpp index e477057797..4353c18792 100644 --- a/src/system/kernel/cache/file_cache.cpp +++ b/src/system/kernel/cache/file_cache.cpp @@ -780,7 +780,10 @@ cache_io(void* _cacheRef, void* cookie, off_t offset, addr_t buffer, if (status != B_OK) return status; - if (page->busy) { + // Since satisfy_cache_io() unlocks the cache, we need to look up + // the page again. + page = cache->LookupPage(offset); + if (page != NULL && page->busy) { cache->WaitForPageEvents(page, PAGE_EVENT_NOT_BUSY, true); continue; }