do_generic_file_read: clear page errors when issuing a fresh read of the page
authorJeff Moyer <jmoyer@redhat.com>
Wed, 26 May 2010 15:49:40 +0000 (11:49 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 26 May 2010 17:20:27 +0000 (10:20 -0700)
I/O errors can happen due to temporary failures, like multipath
errors or losing network contact with the iSCSI server. Because
of that, the VM will retry readpage on the page.

However, do_generic_file_read does not clear PG_error.  This
causes the system to be unable to actually use the data in the
page cache page, even if the subsequent readpage completes
successfully!

The function filemap_fault has had a ClearPageError before
readpage forever.  This patch simply adds the same to
do_generic_file_read.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Rik van Riel <riel@redhat.com>
Acked-by: Larry Woodman <lwoodman@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/filemap.c

index 88d719665a28e8f28b66a9fadffa933ae46b1875..35e12d1865666717f09094090bd5032995b7e63b 100644 (file)
@@ -1105,6 +1105,12 @@ page_not_up_to_date_locked:
                }
 
 readpage:
+               /*
+                * A previous I/O error may have been due to temporary
+                * failures, eg. multipath errors.
+                * PG_error will be set again if readpage fails.
+                */
+               ClearPageError(page);
                /* Start the actual read. The read will unlock the page. */
                error = mapping->a_ops->readpage(filp, page);