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@xxxxxxxx>
---
fs/btrfs/relocation.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 3379850d7695..b31d582a2ca1 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -4470,6 +4470,11 @@ int btrfs_relocate_block_group(struct btrfs_fs_info *fs_info, u64 group_start)
btrfs_info(fs_info, "found %llu extents, stage: %s",
rc->extents_found, stage_to_string(finishes_stage));
+
+ if (should_cancel_balance(fs_info)) {
+ err = -ECANCELED;
+ goto out;
+ }
}
WARN_ON(rc->block_group->pinned > 0);
--
2.25.0