Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Liu Bo and committed by
Chris Mason
5dca6eea 29cc83f6

+2
+2
fs/btrfs/extent_io.c
··· 2367 2367 if (!uptodate) { 2368 2368 ClearPageUptodate(page); 2369 2369 SetPageError(page); 2370 + ret = ret < 0 ? ret : -EIO; 2371 + mapping_set_error(page->mapping, ret); 2370 2372 } 2371 2373 return 0; 2372 2374 }