Skip to contentSkip to conversation

delete from_swap_cache BUG_ONs

PATCH New Hugh Dickins 1 participant 1 message Jul 9, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 delete from_swap_cache BUG_ONs

Three of the four BUG_ONs in delete_from_swap_cache are immediately repeated in __delete_from_swap_cache: delete those and add the one. But perhaps mm/ is altogether overprovisioned with historic BUGs?

---

 mm/swap_state.c |    6 +-----
 1 files changed, 1 insertion(+), 5 deletions(-)
mm/swap_state.c +1 -5
@@ -123,6 +123,7 @@ void __delete_from_swap_cache(struct pag
 	BUG_ON(!PageLocked(page));
 	BUG_ON(!PageSwapCache(page));
 	BUG_ON(PageWriteback(page));
+	BUG_ON(PagePrivate(page));
 
 	radix_tree_delete(&swapper_space.page_tree, page->private);
 	page->private = 0;
@@ -195,11 +196,6 @@ void delete_from_swap_cache(struct page 
 {
 	swp_entry_t entry;
 
-	BUG_ON(!PageSwapCache(page));
-	BUG_ON(!PageLocked(page));
-	BUG_ON(PageWriteback(page));
-	BUG_ON(PagePrivate(page));
-  
 	entry.val = page->private;
 
 	write_lock_irq(&swapper_space.tree_lock);