Commit bff61867 authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds

[PATCH] swap 3/3 unsafe Dirty check

Todd R. Eigenschink <todd@tekinteractive.com> reported 2.4 swapoff
kernel BUG at filemap.c:122 to LKML 24 May.  Other problems on that
system may have contributed, but yes, despite __delete_from_swap_cache
doing ClearPageDirty before __remove_inode_page to avoid the BUG(),
a concurrent zap_pte_range might race to set_page_dirty.  So skip
that oops in PageSwapCache case.  Remove the prior ClearPageDirty?
maybe but not without deeper thought: let stay for now.
parent f53bfec8
......@@ -70,7 +70,7 @@ void __remove_inode_page(struct page *page)
{
struct address_space *mapping = page->mapping;
if (unlikely(PageDirty(page)))
if (unlikely(PageDirty(page)) && !PageSwapCache(page))
BUG();
radix_tree_delete(&page->mapping->page_tree, page->index);
......
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