[PATCH] swap_state.c thinko

Ben LaHaise
2001-04-05T15:56:48Z

Hey folks,

Here's another one liner that closes an smp race that could corrupt
things.

-ben

diff -urN v2.4.3/mm/swap_state.c work-2.4.3/mm/swap_state.c
--- v2.4.3/mm/swap_state.c Fri Dec 29 18:04:27 2000
+++ work-2.4.3/mm/swap_state.c Thu Apr 5 11:55:00 2001
@@ -140,7 +140,7 @@
/*
* If we are the only user, then try to free up the swap cache.
*/
- if (PageSwapCache(page) && !TryLockPage(page)) {
+ if (!TryLockPage(page) && PageSwapCache(page)) {
if (!is_page_shared(page)) {
delete_from_swap_cache_nolock(page);
}