]> git.baikalelectronics.ru Git - kernel.git/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)
committerChris Mason <clm@fb.com>
Fri, 21 Nov 2014 01:14:25 +0000 (17:14 -0800)
commit7989e65a13ccffa4a6c19b18803311f0cddae855
tree99105c7f389873f692c946bc6e36bb95653ff152
parentd40522117ae41711032e61434cda9fb2474bded5
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>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/inode.c