aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2017-07-06 07:02:23 -0400
committerJeff Layton <jlayton@redhat.com>2017-07-06 07:02:23 -0400
commitcbeaf9510a8631e9bb0077a95fd8b0db0b3be200 (patch)
tree4c69537c66c0057e30d7ef7dd2a46f4bdb2f54db /mm/filemap.c
parent76341cabbdad65c10a4162e9dfa82a6342afc02f (diff)
mm: clear AS_EIO/AS_ENOSPC when writeback initiation fails
filemap_write_and_wait{_range} will return an error if writeback initiation fails, but won't clear errors in the address_space. This is particularly problematic on DAX, as filemap_fdatawrite* is effectively synchronous there. Ensure that we clear the AS_EIO/AS_ENOSPC flags when filemap_fdatawrite* returns an error. Signed-off-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index e5711b2728f4..49bc9720fb00 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -515,6 +515,9 @@ int filemap_write_and_wait(struct address_space *mapping)
515 int err2 = filemap_fdatawait(mapping); 515 int err2 = filemap_fdatawait(mapping);
516 if (!err) 516 if (!err)
517 err = err2; 517 err = err2;
518 } else {
519 /* Clear any previously stored errors */
520 filemap_check_errors(mapping);
518 } 521 }
519 } else { 522 } else {
520 err = filemap_check_errors(mapping); 523 err = filemap_check_errors(mapping);
@@ -549,6 +552,9 @@ int filemap_write_and_wait_range(struct address_space *mapping,
549 lstart, lend); 552 lstart, lend);
550 if (!err) 553 if (!err)
551 err = err2; 554 err = err2;
555 } else {
556 /* Clear any previously stored errors */
557 filemap_check_errors(mapping);
552 } 558 }
553 } else { 559 } else {
554 err = filemap_check_errors(mapping); 560 err = filemap_check_errors(mapping);