Commit a838ea3b authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] misc

- I hit a BUG in end_swap_bio_read() under heavy load.  The page
  wasn't locked.  No idea how this can happen :(

  Add a BUG at submission time to catch a caller reading into an
  unlocked swapcache page.

- Remove a debug check from destroy_inode() - it was in the wrong leg
  of the `if' statement anyway.
parent dcffe12e
......@@ -146,12 +146,10 @@ void destroy_inode(struct inode *inode)
if (inode_has_buffers(inode))
BUG();
security_ops->inode_free_security(inode);
if (inode->i_sb->s_op->destroy_inode) {
if (inode->i_sb->s_op->destroy_inode)
inode->i_sb->s_op->destroy_inode(inode);
} else {
BUG_ON(inode->i_data.page_tree.rnode != NULL);
else
kmem_cache_free(inode_cachep, (inode));
}
}
......
......@@ -115,6 +115,7 @@ int swap_readpage(struct file *file, struct page *page)
struct bio *bio;
int ret = 0;
BUG_ON(!PageLocked(page));
ClearPageUptodate(page);
bio = get_swap_bio(GFP_KERNEL, page, end_swap_bio_read);
if (bio == 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