Skip to content

Commit

Permalink
Btrfs: mark mapping with error flag to report errors to userspace
Browse files Browse the repository at this point in the history
According to commit 865ffef
(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>
  • Loading branch information
Liu Bo authored and Chris Mason committed Jun 10, 2014
1 parent 29cc83f commit 5dca6ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2367,6 +2367,8 @@ int end_extent_writepage(struct page *page, int err, u64 start, u64 end)
if (!uptodate) {
ClearPageUptodate(page);
SetPageError(page);
ret = ret < 0 ? ret : -EIO;
mapping_set_error(page->mapping, ret);
}
return 0;
}
Expand Down

0 comments on commit 5dca6ee

Please sign in to comment.