Message ID | 20191203064254.22683-5-wqu@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs: Make balance cancelling response faster | expand |
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 161d66f70190..23aa630f04c9 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -4417,6 +4417,10 @@ int btrfs_relocate_block_group(struct btrfs_fs_info *fs_info, u64 group_start) btrfs_info(fs_info, "found %llu extents", rc->extents_found); + if (should_cancel_balance(fs_info)) { + err = -ECANCELED; + goto out; + } } WARN_ON(rc->block_group->pinned > 0);
There are some reports of dead relocation stage loop, where dmesg is flooded by "Found X extents". The root cause of it is still uncertain, but we can work around such bug by checking cancelling request so user can at least cancel such dead loop. Signed-off-by: Qu Wenruo <wqu@suse.com> --- fs/btrfs/relocation.c | 4 ++++ 1 file changed, 4 insertions(+)