]> git.hungrycats.org Git - linux/commitdiff
[PATCH] misc
authorAndrew Morton <akpm@digeo.com>
Fri, 22 Nov 2002 03:30:10 +0000 (19:30 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Fri, 22 Nov 2002 03:30:10 +0000 (19:30 -0800)
- 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.

fs/inode.c
mm/page_io.c

index acd4421c589093a491196d6639575c11072d222d..24a316ae33f94406884ae7e61ff1e88ee2e9ed0d 100644 (file)
@@ -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));
-       }
 }
 
 
index a600d6adfc310c42b38275f021ea3606bfa3656d..6d8db6c98d8cde8866d7d8b75612fdb416db68a9 100644 (file)
@@ -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) {