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

[PATCH] restore lru_cache_del() in truncate_complete_page

I removed the PF_INVALIDATE debug check from buffercache
leaks, too.  It's non-functional - the flag should have been
set across truncate_inode_pages(), not invalidate_inode_pages().
parent 5dfb4838
...@@ -448,9 +448,7 @@ void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers) ...@@ -448,9 +448,7 @@ void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers)
* We really want to use invalidate_inode_pages2() for * We really want to use invalidate_inode_pages2() for
* that, but not until that's cleaned up. * that, but not until that's cleaned up.
*/ */
current->flags |= PF_INVALIDATE;
invalidate_inode_pages(bdev->bd_inode); invalidate_inode_pages(bdev->bd_inode);
current->flags &= ~PF_INVALIDATE;
} }
void __invalidate_buffers(kdev_t dev, int destroy_dirty_buffers) void __invalidate_buffers(kdev_t dev, int destroy_dirty_buffers)
......
...@@ -393,7 +393,7 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0) ...@@ -393,7 +393,7 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
#define PF_FREEZE 0x00010000 /* this task should be frozen for suspend */ #define PF_FREEZE 0x00010000 /* this task should be frozen for suspend */
#define PF_IOTHREAD 0x00020000 /* this thread is needed for doing I/O to swap */ #define PF_IOTHREAD 0x00020000 /* this thread is needed for doing I/O to swap */
#define PF_FROZEN 0x00040000 /* frozen for system suspend */ #define PF_FROZEN 0x00040000 /* frozen for system suspend */
#define PF_INVALIDATE 0x00080000 /* debug: unmounting an fs. killme. */
/* /*
* Ptrace flags * Ptrace flags
*/ */
......
...@@ -173,17 +173,16 @@ static inline void truncate_partial_page(struct page *page, unsigned partial) ...@@ -173,17 +173,16 @@ static inline void truncate_partial_page(struct page *page, unsigned partial)
} }
/* /*
* AKPM: the PagePrivate test here seems a bit bogus. It bypasses the * If truncate can remove the fs-private metadata from the page, it
* mapping's ->invalidatepage, which may still want to be called. * removes the page from the LRU immediately. This because some other thread
* of control (eg, sendfile) may have a reference to the page. But dropping
* the final reference to an LRU page in interrupt context is illegal - it may
* deadlock over pagemap_lru_lock.
*/ */
static void truncate_complete_page(struct page *page) static void truncate_complete_page(struct page *page)
{ {
/* Drop fs-specific data so the page might become freeable. */ if (!PagePrivate(page) || do_invalidatepage(page, 0))
if (PagePrivate(page) && !do_invalidatepage(page, 0)) { lru_cache_del(page);
if (current->flags & PF_INVALIDATE)
printk("%s: buffer heads were leaked\n",
current->comm);
}
ClearPageDirty(page); ClearPageDirty(page);
ClearPageUptodate(page); ClearPageUptodate(page);
......
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