mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix a bad bug in read_cache_page_async() [try #2]
@ 2007-05-09 12:42 David Howells
  0 siblings, 0 replies; only message in thread
From: David Howells @ 2007-05-09 12:42 UTC (permalink / raw)
  To: torvalds, akpm, npiggin; +Cc: linux-kernel, dhowells

Fix a bad bug in read_cache_page_async() introduced in commit:

	6fe6900e1e5b6fa9e5c59aa5061f244fe3f467e2

This adds:

	mark_page_accessed(page)

into the error handling path in read_cache_page_async().  In such a case,
'page' holds the error code.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 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;
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-09 12:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-09 12:42 [PATCH] Fix a bad bug in read_cache_page_async() [try #2] David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®