diff options
author | Naohiro Aota <naohiro.aota@wdc.com> | 2017-09-01 17:59:07 +0900 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-09-26 14:49:06 +0200 |
commit | 67c003f90fd68062d92a7ffade36f9b2a9098bd8 (patch) | |
tree | 874bcbe06f77eb19a0e5bb5a1bb830354b0af4d9 /fs/btrfs/relocation.c | |
parent | 63d71450c8d817649a79e37d685523f988b9cc98 (diff) |
btrfs: finish ordered extent cleaning if no progress is found
__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")
Cc: <stable@vger.kernel.org> # 4.12
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>
Diffstat (limited to 'fs/btrfs/relocation.c')
0 files changed, 0 insertions, 0 deletions