Commit 029e332e authored by OGAWA Hirofumi's avatar OGAWA Hirofumi Committed by Linus Torvalds
Browse files

[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
Signed-off-by: default avatarOGAWA Hirofumi <>
Cc: Steven French <>
Cc: Miklos Szeredi <>
Cc: Steven Whitehouse <>
Cc: Trond Myklebust <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 5d861d92
......@@ -173,6 +173,8 @@ static int read_pages(struct address_space *mapping, struct file *filp,
if (mapping->a_ops->readpages) {
ret = mapping->a_ops->readpages(filp, mapping, pages, nr_pages);
/* Clean up the remaining pages */
goto out;
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