Commit 4c6924d4 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fix smbfs oops

Silly oversight - read_pages needs to pass the file *
down to ->readpage().
parent 711daf00
...@@ -32,7 +32,7 @@ static inline unsigned long get_min_readahead(struct file *file) ...@@ -32,7 +32,7 @@ static inline unsigned long get_min_readahead(struct file *file)
} }
static int static int
read_pages(struct address_space *mapping, read_pages(struct file *file, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages) struct list_head *pages, unsigned nr_pages)
{ {
unsigned page_idx; unsigned page_idx;
...@@ -44,7 +44,7 @@ read_pages(struct address_space *mapping, ...@@ -44,7 +44,7 @@ read_pages(struct address_space *mapping,
struct page *page = list_entry(pages->prev, struct page, list); struct page *page = list_entry(pages->prev, struct page, list);
list_del(&page->list); list_del(&page->list);
if (!add_to_page_cache_unique(page, mapping, page->index)) if (!add_to_page_cache_unique(page, mapping, page->index))
mapping->a_ops->readpage(NULL, page); mapping->a_ops->readpage(file, page);
page_cache_release(page); page_cache_release(page);
} }
return 0; return 0;
...@@ -167,7 +167,7 @@ void do_page_cache_readahead(struct file *file, ...@@ -167,7 +167,7 @@ void do_page_cache_readahead(struct file *file,
* uptodate then the caller will launch readpage again, and * uptodate then the caller will launch readpage again, and
* will then handle the error. * will then handle the error.
*/ */
read_pages(mapping, &page_pool, nr_to_really_read); read_pages(file, mapping, &page_pool, nr_to_really_read);
blk_run_queues(); blk_run_queues();
BUG_ON(!list_empty(&page_pool)); BUG_ON(!list_empty(&page_pool));
return; return;
......
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