]> git.hungrycats.org Git - linux/commit
Btrfs: fix hang on compressed write error
authorFilipe Manana <fdmanana@suse.com>
Mon, 6 Oct 2014 21:14:23 +0000 (22:14 +0100)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Fri, 23 Jan 2015 13:16:30 +0000 (08:16 -0500)
commite36e239cffa847658393f2c7012e55390e3f68d4
treed554e88db4f7b6eaf315f3ceb1610a965c6099b6
parent6395b4abf4425584bb594e23d3084b56b9fc379f
Btrfs: fix hang on compressed write error

In inode.c:submit_compressed_extents(), before calling btrfs_submit_compressed_write()
we start writeback for all pages, clear their dirty flag, unlock them, etc, but if
btrfs_submit_compressed_write() fails (at the moment it can only fail with -ENOMEM),
we never end the writeback on the pages, so any filemap_fdatawait_range() call will
hang forever. We were also not calling the writepage end io hook, which means the
corresponding ordered extent will never complete and all its waiters will block
forever, such as a full fsync (via btrfs_wait_ordered_range()).

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