diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2014-05-12 00:47:36 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-06-09 20:20:47 -0400 |
commit | 5dca6eea91653e9949ce6eb9e9acab6277e2f2c4 (patch) | |
tree | b170e4ffb449b3cb876efcb1ebbe957c5fc71c8b /fs | |
parent | 29cc83f69c8338ff8fd1383c9be263d4bdf52d73 (diff) |
Btrfs: mark mapping with error flag to report errors to userspace
According to commit 865ffef3797da2cac85b3354b5b6050dc9660978
(fs: fix fsync() error reporting),
it's not stable to just check error pages because pages can be
truncated or invalidated, we should also mark mapping with error
flag so that a later fsync can catch the error.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/extent_io.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index fa31c8d2c095..a55580f4e611 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2367,6 +2367,8 @@ int end_extent_writepage(struct page *page, int err, u64 start, u64 end) | |||
2367 | if (!uptodate) { | 2367 | if (!uptodate) { |
2368 | ClearPageUptodate(page); | 2368 | ClearPageUptodate(page); |
2369 | SetPageError(page); | 2369 | SetPageError(page); |
2370 | ret = ret < 0 ? ret : -EIO; | ||
2371 | mapping_set_error(page->mapping, ret); | ||
2370 | } | 2372 | } |
2371 | return 0; | 2373 | return 0; |
2372 | } | 2374 | } |