Commit 82980ce2 authored by Andrew Morton's avatar Andrew Morton Committed by David Mosberger

[PATCH] remove unsafe BUG_ON()

From: Hugh Dickins <hugh@veritas.com>

PageDirty BUG_ON in __remove_inode_page is, and always has been, unsafe for
SMP or preemption: truncation may be racing against unmapping's
set_page_dirty in zap_pte_range (amongst a few other possibilities).
!PageUptodate error in __set_page_dirty_buffers is unsafe then too.
parent 938da621
......@@ -822,9 +822,6 @@ int __set_page_dirty_buffers(struct page *page)
goto out;
}
if (!PageUptodate(page))
buffer_error();
spin_lock(&mapping->private_lock);
if (page_has_buffers(page)) {
struct buffer_head *head = page_buffers(page);
......
......@@ -81,8 +81,6 @@ void __remove_from_page_cache(struct page *page)
{
struct address_space *mapping = page->mapping;
BUG_ON(PageDirty(page) && !PageSwapCache(page));
radix_tree_delete(&mapping->page_tree, page->index);
list_del(&page->list);
page->mapping = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment