lkml.org 
[lkml]   [2002]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 2/10] radix-tree locking fix


__delete_from_swap_cache modifies the radix tree. We need to take the
lock for writing.


=====================================

--- 2.5.13/mm/swapfile.c~swap-lock-fix Sun May 5 13:31:59 2002
+++ 2.5.13-akpm/mm/swapfile.c Sun May 5 13:31:59 2002
@@ -308,13 +308,13 @@ int remove_exclusive_swap_page(struct pa
retval = 0;
if (p->swap_map[SWP_OFFSET(entry)] == 1) {
/* Recheck the page count with the pagecache lock held.. */
- read_lock(&swapper_space.page_lock);
+ write_lock(&swapper_space.page_lock);
if (page_count(page) - !!PagePrivate(page) == 2) {
__delete_from_swap_cache(page);
SetPageDirty(page);
retval = 1;
}
- read_unlock(&swapper_space.page_lock);
+ write_unlock(&swapper_space.page_lock);
}
swap_info_put(p);


-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.033 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site