When freeing the swap space associated with a page, the page must be

marked modified again, so that we don't lose its data when someone
decides to steal it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26939 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-08-12 00:08:33 +00:00
parent 95accc28f8
commit dce8d473d5

View File

@ -168,7 +168,12 @@ free_page_swap_space(int32 index)
&& page->cache->HasPage(page->cache_offset << PAGE_SHIFT)
&& page->usage_count > 0) {
// TODO: how to judge a page is highly active?
return swap_free_page_swap_space(page);
if (swap_free_page_swap_space(page)) {
// We need to mark the page modified, since otherwise it could be
// stolen and we'd lose its data.
vm_page_set_state(page, PAGE_STATE_MODIFIED);
return true;
}
}
return false;
}