]> git.hungrycats.org Git - linux/commit
Btrfs: report error after failure inlining extent in compressed write path
authorFilipe Manana <fdmanana@suse.com>
Fri, 10 Oct 2014 09:45:12 +0000 (10:45 +0100)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Fri, 23 Jan 2015 13:16:52 +0000 (08:16 -0500)
commitfbedac6c83fab6e5bf009c95584e4380941c6c0c
tree4d4a374bf921665fc2b41cf6637697b38613647a
parent9dba3e3c6c1394e958306d3c9404800ea7481ebb
Btrfs: report error after failure inlining extent in compressed write path

If cow_file_range_inline() failed, when called from compress_file_range(),
we were tagging the locked page for writeback, end its writeback and unlock it,
but not marking it with an error nor setting AS_EIO in inode's mapping flags.

This made it impossible for a caller of filemap_fdatawrite_range (writepages)
or filemap_fdatawait_range() to know that an error happened. And the return
value of compress_file_range() is useless because it's returned to a workqueue
task and not to the task calling filemap_fdatawrite_range (writepages).

This change applies on top of the previous patchset starting at the patch
titled:

    "[1/5] Btrfs: set page and mapping error on compressed write failure"

Which changed extent_clear_unlock_delalloc() to use SetPageError and
mapping_set_error().

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit e6eb43142a72ba356f9fcd0f0fe2169c3642b460)
fs/btrfs/inode.c