Jeff Layton 5e8fcc1a0f mm: don't TestClearPageError in __filemap_fdatawait_range
The -EIO returned here can end up overriding whatever error is marked in
the address space, and be returned at fsync time, even when there is a
more appropriate error stored in the mapping.

Read errors are also sometimes tracked on a per-page level using
PG_error. Suppose we have a read error on a page, and then that page is
subsequently dirtied by overwriting the whole page. Writeback doesn't
clear PG_error, so we can then end up successfully writing back that
page and still return -EIO on fsync.

Worse yet, PG_error is cleared during a sync() syscall, but the -EIO
return from that is silently discarded. Any subsystem that is relying on
PG_error to report errors during fsync can easily lose writeback errors
due to this. All you need is a stray sync() call to wait for writeback
to complete and you've lost the error.

Since the handling of the PG_error flag is somewhat inconsistent across
subsystems, let's just rely on marking the address space when there are
writeback errors. Change the TestClearPageError call to ClearPageError,
and make __filemap_fdatawait_range a void return function.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2017-07-06 07:02:24 -04:00
..
2017-04-18 20:41:12 +02:00
2017-04-18 20:41:12 +02:00
2017-02-27 18:43:47 -08:00
2017-05-03 15:52:12 -07:00
2017-05-03 15:52:10 -07:00
2015-09-08 15:35:28 -07:00
2017-05-03 15:52:10 -07:00
2017-05-03 15:52:10 -07:00
2015-11-05 19:34:48 -08:00
2017-05-03 15:52:10 -07:00
2017-05-03 15:52:10 -07:00
2016-11-02 10:24:03 -06:00
2016-03-17 15:09:34 -07:00
2017-04-13 18:24:21 -07:00