Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c855ff3718e5f667b463b20b9de516b4cd7625ad Commit: c855ff3718e5f667b463b20b9de516b4cd7625ad Parent: aabded9c3aab5160ae2ca3dd1fa0fa37f3d510e4 Author: David Howells <[EMAIL PROTECTED]> AuthorDate: Wed May 9 13:42:20 2007 +0100 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Wed May 9 13:04:03 2007 -0700
Fix a bad error case handling in read_cache_page_async() Commit 6fe6900e1e5b6fa9e5c59aa5061f244fe3f467e2 introduced a nasty bug in read_cache_page_async(). It added a "mark_page_accessed(page)" at the final return path in read_cache_page_async(). But in error cases, 'page' holds the error code, and you can't mark it accessed. [ and Glauber de Oliveira Costa points out that we can use a return instead of adding more goto's ] Signed-off-by: David Howells <[EMAIL PROTECTED]> Acked-by: Nick Piggin <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- mm/filemap.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 9e56fd1..7b48b2a 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1784,7 +1784,7 @@ struct page *read_cache_page_async(struct address_space *mapping, retry: page = __read_cache_page(mapping, index, filler, data); if (IS_ERR(page)) - goto out; + return page; mark_page_accessed(page); if (PageUptodate(page)) goto out; @@ -1802,9 +1802,9 @@ retry: err = filler(data, page); if (err < 0) { page_cache_release(page); - page = ERR_PTR(err); + return ERR_PTR(err); } - out: +out: mark_page_accessed(page); return page; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html