Commit 029e332ea717810172e965ec50f942755ad0c58a

Authored by OGAWA Hirofumi
Committed by Linus Torvalds
1 parent 5d861d920a

[PATCH] Cleanup read_pages()

Current read_pages() assume ->readpages() frees the passed pages.

This patch free the pages in ->read_pages(), if those were remaining in the
pages_list.  So, readpages() just can ignore the remaining pages in
pages_list.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Steven French <sfrench@us.ibm.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

... ... @@ -173,6 +173,8 @@
173 173  
174 174 if (mapping->a_ops->readpages) {
175 175 ret = mapping->a_ops->readpages(filp, mapping, pages, nr_pages);
  176 + /* Clean up the remaining pages */
  177 + put_pages_list(pages);
176 178 goto out;
177 179 }
178 180