Btrfs: mark mapping with error flag to report errors to userspace
authorLiu Bo <bo.li.liu@oracle.com>
Mon, 12 May 2014 04:47:36 +0000 (12:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2014 03:09:46 +0000 (20:09 -0700)
commit372fad07b99cc6a9959bfe6b8f46135970c52a21
treedef01bd86701768554c8c3adee699bddbd8d1fc7
parent791a1cc32d1ba64024db044e738661b5e119d5fa
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>
fs/btrfs/extent_io.c