diff options
author | Rik van Riel <riel@redhat.com> | 2011-01-13 18:46:06 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:35 -0500 |
commit | 212260aa07135b327752dc02625c68cf4ce04caf (patch) | |
tree | 7ea25dddf5f69e91ec4b3d22f940e6c9604c7f93 /include/linux/page-flags.h | |
parent | dabb16f639820267b3850d804571c70bd93d4e07 (diff) |
mm: clear PageError bit in msync & fsync
Temporary IO failures, eg. due to loss of both multipath paths, can
permanently leave the PageError bit set on a page, resulting in msync or
fsync returning -EIO over and over again, even if IO is now getting to the
disk correctly.
We already clear the AS_ENOSPC and AS_IO bits in mapping->flags in the
filemap_fdatawait_range function. Also clearing the PageError bit on the
page allows subsequent msync or fsync calls on this file to return without
an error, if the subsequent IO succeeds.
Unfortunately data written out in the msync or fsync call that returned
-EIO can still get lost, because the page dirty bit appears to not get
restored on IO error. However, the alternative could be potentially all
of memory filling up with uncleanable dirty pages, hanging the system, so
there is no nice choice here...
Signed-off-by: Rik van Riel <riel@redhat.com>
Acked-by: Valerie Aurora <vaurora@redhat.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/page-flags.h')
-rw-r--r-- | include/linux/page-flags.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 5f38c460367e..4805fdec8d6e 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -198,7 +198,7 @@ static inline int __TestClearPage##uname(struct page *page) { return 0; } | |||
198 | struct page; /* forward declaration */ | 198 | struct page; /* forward declaration */ |
199 | 199 | ||
200 | TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked) | 200 | TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked) |
201 | PAGEFLAG(Error, error) | 201 | PAGEFLAG(Error, error) TESTCLEARFLAG(Error, error) |
202 | PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) | 202 | PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) |
203 | PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) | 203 | PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) |
204 | PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru) | 204 | PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru) |