From f3b3dc81a22f506233aeb36fce6fd08de8fe81b6 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 15 Sep 2002 08:50:48 -0700 Subject: [PATCH] [PATCH] hold the page ref across ->readpage read_pages() is dropping the page refcount before running ->readpage(). Which just happens to work, because the page is in pagecache and locked. But it breaks under some unconventional things which reiser4 is doing, and it's better/safer/saner this way anyway. --- mm/readahead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/readahead.c b/mm/readahead.c index 209c9813525d..e1e68fc006dc 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -48,9 +48,9 @@ read_pages(struct file *file, struct address_space *mapping, struct page *page = list_entry(pages->prev, struct page, list); list_del(&page->list); if (!add_to_page_cache(page, mapping, page->index)) { + mapping->a_ops->readpage(file, page); if (!pagevec_add(&lru_pvec, page)) __pagevec_lru_add(&lru_pvec); - mapping->a_ops->readpage(file, page); } else { page_cache_release(page); } -- 2.39.5