diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2014-05-12 08:47:36 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-01 07:09:46 +0400 |
commit | 372fad07b99cc6a9959bfe6b8f46135970c52a21 (patch) | |
tree | def01bd86701768554c8c3adee699bddbd8d1fc7 | |
parent | 791a1cc32d1ba64024db044e738661b5e119d5fa (diff) | |
download | linux-372fad07b99cc6a9959bfe6b8f46135970c52a21.tar.xz |
Btrfs: mark mapping with error flag to report errors to userspace
commit 5dca6eea91653e9949ce6eb9e9acab6277e2f2c4 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 82de09090935..2d391ce71ea4 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2371,6 +2371,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; } |