Commit 5dca6eea authored by Liu Bo's avatar Liu Bo Committed by Chris Mason

Btrfs: mark mapping with error flag to report errors to userspace

According to commit 865ffef3
(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: default avatarLiu Bo <bo.li.liu@oracle.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 29cc83f6
...@@ -2367,6 +2367,8 @@ int end_extent_writepage(struct page *page, int err, u64 start, u64 end) ...@@ -2367,6 +2367,8 @@ int end_extent_writepage(struct page *page, int err, u64 start, u64 end)
if (!uptodate) { if (!uptodate) {
ClearPageUptodate(page); ClearPageUptodate(page);
SetPageError(page); SetPageError(page);
ret = ret < 0 ? ret : -EIO;
mapping_set_error(page->mapping, ret);
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment