mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 05:17:10 +09:00
Btrfs: mark mapping with error flag to report errors to userspace
commit5dca6eea91upstream. According to commit865ffef379(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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c6b4616c41
commit
8d7293457e
@@ -2368,6 +2368,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user