Update of /cvsroot/linuxcompressed/linux/mm
In directory usw-pr-cvs1:/tmp/cvs-serv19795/mm
Modified Files:
memory.c
Log Message:
Bug fixes
o Fixed race between comp_cache_use_address() and do_swap_page(). A pte
could be unsafely changed during a page fault service.
Index: memory.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/memory.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** memory.c 16 Jul 2002 18:41:55 -0000 1.34
--- memory.c 18 Jul 2002 13:32:50 -0000 1.35
***************
*** 1130,1133 ****
--- 1130,1134 ----
int ret = 1;
+ get_vswap(entry);
spin_unlock(&mm->page_table_lock);
page = lookup_swap_cache(entry);
***************
*** 1135,1145 ****
/* perform readahead only if the page is on disk */
if (!in_comp_cache(&swapper_space, entry.val)) {
swapin_readahead(entry);
/* major fault */
ret = 2;
}
- get_vswap(entry);
page = read_swap_cache_async(entry);
- put_vswap(entry);
if (!page) {
/*
--- 1136,1146 ----
/* perform readahead only if the page is on disk */
if (!in_comp_cache(&swapper_space, entry.val)) {
+ if (vswap_address(entry))
+ BUG();
swapin_readahead(entry);
/* major fault */
ret = 2;
}
page = read_swap_cache_async(entry);
if (!page) {
/*
***************
*** 1151,1154 ****
--- 1152,1156 ----
retval = pte_same(*page_table, orig_pte) ? -1 : 1;
spin_unlock(&mm->page_table_lock);
+ put_vswap(entry);
return retval;
}
***************
*** 1168,1171 ****
--- 1170,1174 ----
unlock_page(page);
page_cache_release(page);
+ put_vswap(entry);
return 1;
}
***************
*** 1194,1197 ****
--- 1197,1201 ----
update_mmu_cache(vma, address, pte);
spin_unlock(&mm->page_table_lock);
+ put_vswap(entry);
return ret;
}
|