]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
btrfs: finish ordered extent cleaning if no progress is found
authorNaohiro Aota <naohiro.aota@wdc.com>
Fri, 1 Sep 2017 08:59:07 +0000 (17:59 +0900)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 12 Oct 2017 21:20:52 +0000 (16:20 -0500)
commit96c2e2ca959e9391159212e917c09d9e03689ad4
treef49dba4cc9db4098a0b1de7b9f3af3400c5494e7
parent7dbc5302b5462f80c36b8d4c27d78d0eed05416b
btrfs: finish ordered extent cleaning if no progress is found

BugLink: http://bugs.launchpad.net/bugs/1721777
commit 67c003f90fd68062d92a7ffade36f9b2a9098bd8 upstream.

__endio_write_update_ordered() repeats the search until it reaches the end
of the specified range. This works well with direct IO path, because before
the function is called, it's ensured that there are ordered extents filling
whole the range. It's not the case, however, when it's called from
run_delalloc_range(): it is possible to have error in the midle of the loop
in e.g. run_delalloc_nocow(), so that there exisits the range not covered
by any ordered extents. By cleaning such "uncomplete" range,
__endio_write_update_ordered() stucks at offset where there're no ordered
extents.

Since the ordered extents are created from head to tail, we can stop the
search if there are no offset progress.

Fixes: 524272607e88 ("btrfs: Handle delalloc error correctly to avoid ordered extent hang")
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/btrfs/inode.c