]> git.hungrycats.org Git - linux/commit
Btrfs: set page and mapping error on compressed write failure
authorFilipe Manana <fdmanana@suse.com>
Mon, 6 Oct 2014 21:14:22 +0000 (22:14 +0100)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Fri, 23 Jan 2015 13:16:31 +0000 (08:16 -0500)
commitb406ccae8d64c6879318b2b602a3a415f1f9029a
treedbab2471da7268bd5c151ecb0e997e7ade560e85
parente36e239cffa847658393f2c7012e55390e3f68d4
Btrfs: set page and mapping error on compressed write failure

If we fail in submit_compressed_extents() before calling btrfs_submit_compressed_write(),
we start and end the writeback for the pages (clear their dirty flag, unlock them, etc)
but we don't tag the pages, nor the inode's mapping, with an error. This makes it
impossible for a caller of filemap_fdatawait_range() (fsync, or transaction commit
for e.g.) know that there was an error.

Note that the return value of submit_compressed_extents() is useless, as that function
is executed by a workqueue task and not directly by the fill_delalloc callback. This
means the writepage/s callbacks of the inode's address space operations don't get that
return value.

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